diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-01 14:54:51 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-01 16:06:58 -0800 |
| commit | f76e6c39f6f2bfef58e77cf786be8d5e1e19592c (patch) | |
| tree | 39f5abebef3a22153709dc66f5c76fc8bd82b4d3 /src/rt/test/rust_test_runtime.cpp | |
| parent | 6b5f7865bea09737f67fa7ff5af5ee49b52955bb (diff) | |
| download | rust-f76e6c39f6f2bfef58e77cf786be8d5e1e19592c.tar.gz rust-f76e6c39f6f2bfef58e77cf786be8d5e1e19592c.zip | |
rt: Fix lock_held_by_current_thread
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.
Diffstat (limited to 'src/rt/test/rust_test_runtime.cpp')
0 files changed, 0 insertions, 0 deletions
