|
@@ -1,14 +1,14 @@
|
|
#include "pthread_impl.h"
|
|
#include "pthread_impl.h"
|
|
#include <threads.h>
|
|
#include <threads.h>
|
|
|
|
|
|
-int __pthread_mutex_trylock(mtx_t *);
|
|
|
|
|
|
+int __pthread_mutex_trylock(pthread_mutex_t *);
|
|
|
|
|
|
int mtx_trylock(mtx_t *m)
|
|
int mtx_trylock(mtx_t *m)
|
|
{
|
|
{
|
|
if (m->_m_type == PTHREAD_MUTEX_NORMAL)
|
|
if (m->_m_type == PTHREAD_MUTEX_NORMAL)
|
|
return (a_cas(&m->_m_lock, 0, EBUSY) & EBUSY) ? thrd_busy : thrd_success;
|
|
return (a_cas(&m->_m_lock, 0, EBUSY) & EBUSY) ? thrd_busy : thrd_success;
|
|
|
|
|
|
- int ret = __pthread_mutex_trylock(m);
|
|
|
|
|
|
+ int ret = __pthread_mutex_trylock((pthread_mutex_t *)m);
|
|
switch (ret) {
|
|
switch (ret) {
|
|
default: return thrd_error;
|
|
default: return thrd_error;
|
|
case 0: return thrd_success;
|
|
case 0: return thrd_success;
|