1 |
/* Try to Lock a mutex. Generic version. |
/* Try to Lock a mutex. Generic version. |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
Copyright (C) 2002, 2005 Free Software Foundation, Inc. |
3 |
This file is part of the GNU C Library. |
This file is part of the GNU C Library. |
4 |
|
|
5 |
The GNU C Library is free software; you can redistribute it and/or |
The GNU C Library is free software; you can redistribute it and/or |
23 |
|
|
24 |
#define LOSE do { * (int *) 0 = 0; } while (1) |
#define LOSE do { * (int *) 0 = 0; } while (1) |
25 |
|
|
26 |
/* Lock MUTEX, block if we can't get it. */ |
/* Lock MUTEX, return EBUSY if we can't get it. */ |
27 |
int |
int |
28 |
__pthread_mutex_trylock (struct __pthread_mutex *mutex) |
__pthread_mutex_trylock (struct __pthread_mutex *mutex) |
29 |
{ |
{ |
82 |
} |
} |
83 |
} |
} |
84 |
|
|
85 |
|
__pthread_spin_unlock (&mutex->__lock); |
86 |
|
|
87 |
return err; |
return err; |
88 |
} |
} |
89 |
|
|