f76e6c39f6f2bfef58e77cf786be8d5e1e19592c
This simplifies the check for thread ownership by removing the _locked flag and just comparing against the thread ID of the last thread to take the lock. If the running thread took the lock _holding_thread will be equal to pthread_self(); if _holding_thread is some other value then the running thread does not have the lock. Setting a pthread_t to 0 like this is not portable but should work on every platform we are likely to care about for the near future.
This is a compiler and suite of associated libraries and documentation for the Rust programming language. See LICENSE.txt for terms of copyright and redistribution. See http://www.rust-lang.org for more information.
Description
Languages
Rust
96%
Shell
0.9%
JavaScript
0.7%
C
0.4%
Python
0.4%
Other
1.5%