v76a Unsafe call!!!!!

Monkey Forums/Monkey Programming/v76a Unsafe call!!!!!

Skn3(Posted 2013) [#1]
Just messing around with creating a very simple lock/unlock mutex mechanism.

On unsupported devices I want to fake the mutex system so I just added a Mutex class that handles this. For native code I will eventually use native locking calls to handle the locks.



This works fine on android, but if I compile for glfw I get:
ATTENTION: Compilation error reported by Trans: Unsafe call!!!!!



marksibly(Posted 2013) [#2]
brl.thread is really meant for internal use only - in particular, gc is single threaded so calling Monkey functions on a thread can be decidedly deadly if gc ends up being invoked.

To that end, there's some fudge in there that means method/function names with __UNSAFE__ in them can only other __UNSAFE__ methods/functions - or, native methods/functions.


Skn3(Posted 2013) [#3]
Ah ok cheers for the clarification. Any plans on improving the threading support to make it more robust?

Some basic block control and signalling would be helpful.


Samah(Posted 2013) [#4]
I suppose I could finish off Diddy's threading side-project...
There's a couple of unimplemented targets, but other than that it's essentially a simplified posix-thread implementation.

https://code.google.com/p/diddy/source/browse/#hg%2Fsrc%2Fthreading