From 448ebb9c59a69e417ded4fe181906305cb2ae4a4 Mon Sep 17 00:00:00 2001 From: kib Date: Thu, 26 Feb 2015 16:39:57 +0000 Subject: Use pthread_mutex_trylock(3) to implement mtx_trylock(3). Noted and tested by: Vineela PR: 198050 Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libstdthreads/mtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libstdthreads/mtx.c') diff --git a/lib/libstdthreads/mtx.c b/lib/libstdthreads/mtx.c index 6c9166d..f38fbae 100644 --- a/lib/libstdthreads/mtx.c +++ b/lib/libstdthreads/mtx.c @@ -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: -- cgit v1.1