Searched refs:mutex (Results 1 - 25 of 347) sorted by relevance

1234567891011>>

/haiku-fatelf/src/libs/posix_error_mapper/
H A Dpthread_mutex.cpp11 WRAPPER_FUNCTION(int, pthread_mutex_destroy, (pthread_mutex_t *mutex),
12 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_destroy(mutex));
17 (pthread_mutex_t *mutex, int *_priorityCeiling),
18 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_getprioceiling(mutex,
24 (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr),
25 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_init(mutex, attr));
29 WRAPPER_FUNCTION(int, pthread_mutex_lock, (pthread_mutex_t *mutex),
30 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_lock(mutex));
35 (pthread_mutex_t *mutex, int newPriorityCeiling,
37 return B_TO_POSITIVE_ERROR(sReal_pthread_mutex_setprioceiling(mutex,
[all...]
/haiku-fatelf/src/libs/compat/freebsd_network/compat/sys/
H A Dmutex.h46 mtx_lock(struct mtx* mutex) argument
48 if (mutex->type == MTX_DEF) {
49 mutex_lock(&mutex->u.mutex.lock);
50 mutex->u.mutex.owner = find_thread(NULL);
51 } else if (mutex->type == MTX_RECURSE)
52 recursive_lock_lock(&mutex->u.recursive);
57 mtx_unlock(struct mtx* mutex) argument
59 if (mutex
68 mtx_initialized(struct mtx* mutex) argument
76 mtx_owned(struct mtx* mutex) argument
[all...]
H A D_mutex.h17 mutex lock;
19 } mutex; member in union:mtx::__anon4691
/haiku-fatelf/src/libs/compat/freebsd_network/
H A Dmutex.c10 #include <compat/sys/mutex.h>
21 mtx_init(struct mtx *mutex, const char *name, const char *type, argument
25 recursive_lock_init_etc(&mutex->u.recursive, name,
28 mutex_init_etc(&mutex->u.mutex.lock, name, MUTEX_FLAG_CLONE_NAME);
29 mutex->u.mutex.owner = -1;
32 mutex->type = options;
37 mtx_destroy(struct mtx *mutex) argument
39 if ((mutex
[all...]
H A Dcondvar.c7 #include <compat/sys/mutex.h>
25 int cv_timedwait(struct cv* variable, struct mtx* mutex, int timeout) argument
29 mtx_unlock(mutex);
31 mtx_lock(mutex);
37 void cv_wait(struct cv* variable, struct mtx* mutex) argument
39 mtx_unlock(mutex);
41 mtx_lock(mutex);
H A Dsynch.c9 #include <compat/sys/mutex.h>
16 msleep(void* identifier, struct mtx* mutex, int priority, argument
24 mtx_unlock(mutex);
26 mtx_lock(mutex);
/haiku-fatelf/src/system/libroot/posix/pthread/
H A Dpthread_mutex.cpp21 #define MUTEX_TYPE(mutex) ((mutex)->flags & MUTEX_TYPE_BITS)
31 pthread_mutex_init(pthread_mutex_t* mutex, const pthread_mutexattr_t* _attr) argument
36 mutex->lock = 0;
37 mutex->owner = -1;
38 mutex->owner_count = 0;
39 mutex->flags = attr->type | (attr->process_shared ? MUTEX_FLAG_SHARED : 0);
46 pthread_mutex_destroy(pthread_mutex_t* mutex) argument
53 mutex_lock(pthread_mutex_t* mutex, bigtime_t timeout) argument
57 if (mutex
105 pthread_mutex_lock(pthread_mutex_t* mutex) argument
112 pthread_mutex_trylock(pthread_mutex_t* mutex) argument
119 pthread_mutex_timedlock(pthread_mutex_t* mutex, const struct timespec* tv) argument
141 pthread_mutex_unlock(pthread_mutex_t* mutex) argument
165 pthread_mutex_getprioceiling(pthread_mutex_t* mutex, int* _prioCeiling) argument
178 pthread_mutex_setprioceiling(pthread_mutex_t* mutex, int prioCeiling, int* _oldCeiling) argument
[all...]
H A Dpthread_cond.cpp39 cond->mutex = NULL;
55 cond_wait(pthread_cond_t* cond, pthread_mutex_t* mutex, bigtime_t timeout) argument
57 if (mutex->owner != find_thread(NULL)) {
58 // calling thread isn't mutex owner
62 if (cond->mutex != NULL && cond->mutex != mutex) {
63 // condition variable already used with different mutex
67 cond->mutex = mutex;
119 pthread_cond_timedwait(pthread_cond_t* cond, pthread_mutex_t* mutex, const struct timespec* tv) argument
[all...]
/haiku-fatelf/src/system/boot/arch/arm/
H A Dkernel_stubs.cpp37 _mutex_lock(mutex*, bool)
44 _mutex_unlock(mutex*, bool)
/haiku-fatelf/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_mutex_destroy/
H A D2-1.c9 * a destroyed mutex object can be reinitialized using pthread_mutex_init()
19 pthread_mutex_t mutex; local
21 /* Initialize a mutex attributes object */
22 if(pthread_mutex_init(&mutex,NULL) != 0)
24 fprintf(stderr,"Cannot initialize mutex object\n");
28 /* Destroy the mutex attributes object */
29 if(pthread_mutex_destroy(&mutex) != 0)
31 fprintf(stderr,"Cannot destroy the mutex object\n");
35 /* Initialize the mutex attributes object again. This shouldn't result in an error. */
36 if(pthread_mutex_init(&mutex,NUL
[all...]
H A D5-1.c8 * It shall be safe to destroy an initialized mutex that is unlocked.
16 pthread_mutex_t mutex; variable
22 /* Initialize mutex with the default mutex attributes */
23 if((rc=pthread_mutex_init(&mutex, NULL)) != 0) {
24 fprintf(stderr,"Fail to initialize mutex, rc=%d\n",rc);
28 /* Lock mutex */
29 if((rc=pthread_mutex_lock(&mutex)) != 0) {
35 if((rc=pthread_mutex_unlock(&mutex)) != 0) {
39 /* Destroy mutex afte
[all...]
H A D3-1.c20 pthread_mutex_t mutex; local
23 /* Initialize a mutex object */
24 if((rc=pthread_mutex_init(&mutex,NULL)) != 0) {
25 fprintf(stderr,"Fail to initialize mutex, rc=%d\n",rc);
29 if((rc=pthread_mutex_destroy(&mutex)) == 0) {
36 fprintf(stderr,"Detected an attempt to destroy a mutex in use\n");
39 fprintf(stderr,"The value specified by 'mutex' is invalid\n");
/haiku-fatelf/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_mutex_trylock/
H A D4-1.c10 * -[EBUSY] The mutex could not be acquired because it was already locked.
13 * -- Initilize a mutex object
14 * -- Lock the mutex using pthread_mutex_lock()
15 * -- Try to lock the mutex using pthread_mutex_trylock() and expect EBUSY
24 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; variable
30 if((rc=pthread_mutex_lock(&mutex))!=0) {
35 rc = pthread_mutex_trylock(&mutex);
42 pthread_mutex_unlock(&mutex);
43 pthread_mutex_destroy(&mutex);
H A D3-1.c20 pthread_mutex_t mutex; local
23 /* Initialize a mutex object with the default mutex attributes */
24 if((rc=pthread_mutex_init(&mutex,NULL)) != 0) {
29 /* Try to lock the mutex using pthread_mutex_trylock() */
30 if((rc=pthread_mutex_trylock(&mutex)) == 0) {
31 pthread_mutex_unlock(&mutex);
37 /* PATCH: since we are using the mutex properly,*/
40 fprintf(stderr,"The mutex was already locked\n");
43 fprintf(stderr,"Invalid mutex objec
[all...]
/haiku-fatelf/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_mutex_unlock/
H A D1-1.c9 * shall release the mutex object 'mutex'.
12 * -- Initilize a mutex object
13 * -- Get the mutex using pthread_mutex_lock()
14 * -- Release the mutex using pthread_mutex_unlock()
15 * -- Try to get the mutex using pthread_mutex_trylock()
16 * -- Release the mutex using pthread_mutex_unlock()
25 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; variable
31 /* Get the mutex using pthread_mutex_lock() */
32 if((rc=pthread_mutex_lock(&mutex)) !
[all...]
/haiku-fatelf/src/add-ons/translators/exr/openexr/ilmthread/
H A DIlmThreadSemaphorePosixCompat.cpp56 if (int error = ::pthread_mutex_init (&_semaphore.mutex, 0))
57 Iex::throwErrnoExc ("Cannot initialize mutex (%T).", error);
72 error = ::pthread_mutex_destroy (&_semaphore.mutex);
80 ::pthread_mutex_lock (&_semaphore.mutex);
87 &_semaphore.mutex))
89 ::pthread_mutex_unlock (&_semaphore.mutex);
99 ::pthread_mutex_unlock (&_semaphore.mutex);
106 ::pthread_mutex_lock (&_semaphore.mutex);
110 ::pthread_mutex_unlock (&_semaphore.mutex);
116 ::pthread_mutex_unlock (&_semaphore.mutex);
[all...]
/haiku-fatelf/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_mutexattr_settype/
H A D3-1.c12 * Provides errorchecking. A thread attempting to relock this mutex without unlocking it
13 * first will return with an error. A thread attempting to unlock a mutex which another
15 * mutex will return with an error.
20 * 3. Create a mutex with that mutexattr object.
21 * 4. Attempt to relock a mutex without unlocking it first. It should return an error.
34 pthread_mutex_t mutex; local
37 /* Initialize a mutex attributes object */
51 /* Initialize the mutex with that attribute obj. */
52 if(pthread_mutex_init(&mutex, &mta) != 0)
54 perror("Error intializing the mutex
[all...]
H A D3-4.c12 Provides errorchecking. A thread attempting to relock this mutex without unlocking it
13 first will return with an error. A thread attempting to unlock a mutex which another
15 mutex will return with an error.
20 * 3. Create a mutex with that mutexattr object.
21 * 4. Attempt to unlock an unlocked mutex. It should return an error.
34 pthread_mutex_t mutex; local
37 /* Initialize a mutex attributes object */
51 /* Initialize the mutex with that attribute obj. */
52 if(pthread_mutex_init(&mutex, &mta) != 0)
54 perror("Error intializing the mutex
[all...]
H A D3-3.c12 Provides errorchecking. A thread attempting to relock this mutex without unlocking it
13 first will return with an error. A thread attempting to unlock a mutex which another
15 mutex will return with an error.
20 * 3. Create a mutex with that mutexattr object.
34 pthread_mutex_t mutex; local
37 /* Initialize a mutex attributes object */
51 /* Initialize the mutex with that attribute obj. */
52 if(pthread_mutex_init(&mutex, &mta) != 0)
54 perror("Error intializing the mutex.\n");
58 /* Unlock an already unlocked mutex
[all...]
H A D3-2.c12 * Provides errorchecking. A thread attempting to relock this mutex without unlocking it
13 * first will return with an error. A thread attempting to unlock a mutex which another
15 * mutex will return with an error.
20 * 3. Create a mutex with that mutexattr object.
21 * 4. Lock the mutex.
22 * 5. Create a thread, and in that thread, attempt to unlock the mutex. It should return an
35 pthread_mutex_t mutex; variable
38 int ret; /* Return value of the thread unlocking the mutex. */
42 /* Try to unlock the mutex that main already locked. */
43 ret=pthread_mutex_unlock(&mutex);
[all...]
/haiku-fatelf/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_mutex_init/
H A D2-1.c9 * Upon successful initialization, the state of the mutex becomes
21 pthread_mutex_t mutex; local
24 /* Initialize a mutex object */
25 if((rc=pthread_mutex_init(&mutex,NULL)) != 0) {
26 fprintf(stderr,"Fail to initialize mutex, rc=%d\n",rc);
31 /* Acquire the mutex object using pthread_mutex_lock */
32 if((rc=pthread_mutex_lock(&mutex)) != 0) {
33 fprintf(stderr,"Fail to lock the mutex, rc=%d\n",rc);
37 fprintf(stderr,"Main: hold the mutex for a while\n");
40 /* Release the mutex objec
[all...]
/haiku-fatelf/src/bin/gdb/gdb/osf-share/
H A Dcma_mutex.h17 * Header file for mutex operations
47 cma_t_integer nest_count; /* Nesting level for recursive mutex */
50 struct CMA__T_INT_MUTEX *int_lock; /* Internal protection for mutex */
54 cma_t_mutex_kind mutex_kind; /* Kind of mutex */
63 * Lock a mutex (internal)
67 * mutex Pointer to mutex object to lock
86 # define cma__int_lock(mutex) { \
87 if (cma__test_and_set (&((cma__t_int_mutex *)mutex)->lock)) { \
89 res = cma__int_mutex_block ((cma__t_int_mutex *)mutex); \
[all...]
/haiku-fatelf/src/add-ons/kernel/drivers/network/usb_ecm/
H A DBeOSCompatibility.h21 typedef struct mutex { struct
24 } mutex; typedef in typeref:struct:mutex
28 mutex_init(mutex *lock, const char *name)
36 mutex_destroy(mutex *lock)
43 mutex_lock(mutex *lock)
52 mutex_unlock(mutex *lock)
/haiku-fatelf/src/add-ons/kernel/drivers/ports/pc_serial/
H A DBeOSCompatibility.h5 typedef struct mutex { struct
8 } mutex; typedef in typeref:struct:mutex
12 mutex_init(mutex *ben, const char *name)
27 mutex_destroy(mutex *ben)
35 mutex_lock(mutex *ben)
45 mutex_unlock(mutex *ben)
/haiku-fatelf/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_mutex_getprioceiling/
H A D1-1.c10 * returns the current prioceiling of the mutex.
32 pthread_mutex_t mutex; local
35 /* Initialize a mutex object */
36 if(pthread_mutex_init(&mutex, NULL) != 0)
42 /* Get the prioceiling of the mutex. */
43 if(pthread_mutex_getprioceiling(&mutex, &prioceiling) != 0)

Completed in 100 milliseconds

1234567891011>>