Thank you both :)
And suddenly everything works (even my more complex test case).


2014-06-10 20:01 GMT+02:00 Steven G. Johnson <[email protected]>:

> Probably this is another instance of:
> https://github.com/JuliaLang/julia/issues/7140
>
> The issue is that the async API was changed in 0.3, so if you are using an
> 0.3 snapshot then you need to change your cb function so that it only takes
> one argument, data --- the status argument was eliminated.
>
>
> On Tuesday, June 10, 2014 1:55:56 PM UTC-4, Valentin Churavy wrote:
>>
>> Hey there,
>>
>> I am trying to create an asynchronous thread-safe callback following the
>> guidelines here http://julia.readthedocs.org/en/latest/manual/calling-
>> c-and-fortran-code/#thread-safety
>>
>> Trying to do one thing after another I tried to manually call my callback
>> via the thread safe and asynchronous matter described in the documentation.
>>
>> My basic test case looks like this:
>>
>> success = false
>> function cb(status, data)
>>   println(status)
>>   println(data)
>>   success = true
>>   return nothing
>> end
>>
>>
>> cb_packaged = Base.SingleAsyncWork(cb)
>>
>> ccall(:uv_async_send, Void, (Ptr{Void},), cb_packaged.handle)
>>
>>
>> yield()
>>
>> Since all this happens in one thread I would assume that this should work
>> without a problem. But nothing happens, no error, no SIGSEV.
>>
>> Any idea where I might be going wrong?
>>
>> Best,
>> Valentin
>>
>

Reply via email to