Use pthread_mutex_trylock(3) to implement mtx_trylock(3).

Noted and tested by:	Vineela <vineela_17@yahoo.com>
PR:	198050
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
kib 2015-02-26 16:39:57 +00:00
parent 4be3c87640
commit 448ebb9c59

View File

@ -96,7 +96,7 @@ int
mtx_trylock(mtx_t *mtx)
{
switch (pthread_mutex_lock(mtx)) {
switch (pthread_mutex_trylock(mtx)) {
case 0:
return (thrd_success);
case EBUSY: