fx: implement mutex support
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
#include <fx/thread.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
bool fx_mutex_lock(fx_mutex *mut)
|
||||||
|
{
|
||||||
|
return pthread_mutex_lock(mut) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool fx_mutex_trylock(fx_mutex *mut)
|
||||||
|
{
|
||||||
|
return pthread_mutex_trylock(mut) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool fx_mutex_unlock(fx_mutex *mut)
|
||||||
|
{
|
||||||
|
return pthread_mutex_trylock(mut) == 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#include <fx/thread.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
bool fx_mutex_lock(fx_mutex *mut)
|
||||||
|
{
|
||||||
|
return pthread_mutex_lock(mut) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool fx_mutex_trylock(fx_mutex *mut)
|
||||||
|
{
|
||||||
|
return pthread_mutex_trylock(mut) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool fx_mutex_unlock(fx_mutex *mut)
|
||||||
|
{
|
||||||
|
return pthread_mutex_trylock(mut) == 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user