pthreads :: NativePthreadMutex :: lock
pthreads :: NativePthreadMutex :: new
pthreads :: NativePthreadMutex :: unlock
pthreads $ NativePthreadMutex :: SELF
Type of this instance, automatically specialized in every classcore :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
pthreads :: NativePthreadMutex :: lock
core :: Object :: native_class_name
The class name of the object in CString format.core :: Pointer :: native_equals
pthreads :: NativePthreadMutex :: new
core :: Object :: output_class_name
Display class name on stdout (debug only).core :: Pointer :: premultiply_alpha
Multiply RGB values by their alpha valuepthreads :: NativePthreadMutex :: unlock
private extern class NativePthreadMutex in "C" `{ pthread_mutex_t * `}
new (attr: NativePthreadMutexAttr) `{
pthread_mutex_t *mutex = malloc(sizeof(pthread_mutex_t));
int r = pthread_mutex_init(mutex, attr);
if (r != 0) {
free(mutex);
return NULL;
}
return mutex;
`}
fun destroy `{ pthread_mutex_destroy(self); `}
fun lock `{ pthread_mutex_lock(self); `}
fun try_lock: Bool `{ return pthread_mutex_trylock(self); `}
fun unlock `{ pthread_mutex_unlock(self); `}
end
lib/pthreads/pthreads.nit:210,1--226,3