Bug 198050 - mtx_trylock from libstdthreads is blocking
Summary: mtx_trylock from libstdthreads is blocking
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: threads (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-threads (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-26 10:20 UTC by Vineela
Modified: 2015-05-15 16:13 UTC (History)
1 user (show)

See Also:


Attachments
Use pthread_mutex_trylock(). (332 bytes, patch)
2015-02-26 11:11 UTC, Konstantin Belousov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vineela 2015-02-26 10:20:09 UTC
mtx_trylock from mtx.c in libstdthreads calls pthread_mutex_lock instead of pthread_mutex_trylock and thus is blocking.
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2015-02-26 11:11:52 UTC
Created attachment 153543 [details]
Use pthread_mutex_trylock().

This is the typo, code correctly tests for EBUSY, but called wrong function.

Please test.
Comment 2 Vineela 2015-02-26 16:02:39 UTC
Comment on attachment 153543 [details]
Use pthread_mutex_trylock().

Works fine. Thank you.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-02-26 16:40:53 UTC
A commit references this bug:

Author: kib
Date: Thu Feb 26 16:39:57 UTC 2015
New revision: 279326
URL: https://svnweb.freebsd.org/changeset/base/279326

Log:
  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

Changes:
  head/lib/libstdthreads/mtx.c