-
-
Notifications
You must be signed in to change notification settings - Fork 11
Goliath1 edited this page Dec 22, 2014
·
12 revisions
A library providing specific CSharp features.
When necessary to use CSharp platform, one face the trouble when some specific CSharp keywords is lacking in Haxe. The library helps to use them. By now there is just one class Synchro providing thread synchronization.
A static class providing synchronisation. It has two methods: lock and mutex.
Lock method implements a lock keyword. CSharp syntax is:
lock(LockedObject)
{
/*Some code to synchronize.*/
}
The method needs two arguments: an object (Dynamic) and a callback (Void -> Void), so syntax looks like this:
lock(lockedObject, function()
{
/*Some code.*/
});
or
lock(lockedObject, someFunc);
...
function someFunc():Void
{
/*Some code.*/
}
Note, that lockedOblect can be only of reference type. If it is not, SynchronizationLockException will be thrown.