Feature #23

C# support - .net core

Added by Madars about 8 years ago. Updated over 6 years ago.

Status:NewStart date:02/05/2016
Priority:Low (Code 5)Due date:
Assignee:Madars% Done:

0%

Category:-
Target version:-

c-callback.tar.gz (22.9 KB) Madars, 01/02/2018 03:23 PM

History

#1 Updated by Madars about 8 years ago

  • Priority changed from Normal (Code 4) to Low (Code 5)

#2 Updated by Madars about 7 years ago

  • Subject changed from C#/mono support to C# support - .net core

#3 Updated by Madars over 6 years ago

Performed tests with: https://github.com/dotnet/corefx/issues/14540

Attached archive with working code. Basically c# calls C, gives it delegate to call back. I have added extra argument to delegate/callback function:

$ ./run.sh 
clang++ -shared -fPIC -std=c++11 ./reversepinvokefromthread.cpp -o reversepinvokefromthread.so
dotnet run
Got here number: 1
Sleeping in Main ...
sleeping for 5 sec ...  ... after sleep trying to callback from new thread .. 0x7fa8dd6c307c
Got here number: 2
sleeping for 5 sec .

See c-callback.tar.gz, just run.sh (it will export library path and run off make) and run off the test.

Also available in: Atom PDF