about summary refs log tree commit diff
path: root/src/rt/sync/lock_and_signal.h
AgeCommit message (Collapse)AuthorLines
2013-11-18Remove the C++ lock_and_signal typeAlex Crichton-63/+0
A the same time this purges all runtime support needed for statically initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-13add rust_trylock_little_lockJason Toffaletti-0/+1
Try to acquire lock and succeed only if lock is not already held. Uses TryEnterCriticalSection or pthread_mutex_trylock.
2013-01-17Add a license check to tidy. #4018Brian Anderson-1/+0
2012-12-10Add license boilerplate to more files.Graydon Hoare-0/+10
2012-04-03Refactor includes structure, getting rid of rust_internal.hJon Morton-0/+2
Many changes to code structure are included: - removed TIME_SLICE_IN_MS - removed sychronized_indexed_list - removed region_owned - kernel_owned move to kernel.h, task_owned moved to task.h - global configs moved to rust_globals.h - changed #pragma once to standard guard in rust_upcall.h - got rid of memory.h
2012-03-31Revert "rt: Remove lock_held_by_current_thread"Brian Anderson-0/+19
Adds back the ability to make assertions about locks, but only under the --enable-debug configuration This reverts commit b247de64583e2ab527088813ba9192824554e801. Conflicts: src/rt/rust_sched_loop.cpp
2012-03-18rt: Remove lock_held_by_current_threadBrian Anderson-5/+0
2012-02-02rt: Remove lock_and_signal::signal_allBrian Anderson-1/+0
2012-02-02rt: Remove lock_and_signal::timed_waitBrian Anderson-1/+0
2012-02-01rt: Fix lock_held_by_current_threadBrian Anderson-1/+0
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.
2012-02-01rt: Remove unused variable from lock_and_signalBrian Anderson-2/+0
2011-07-28Made task threads wait instead of sleep, so they can be woken up. This ↵Eric Holk-1/+4
appears to give us much better parallel performance. Also, commented out one more unsafe log and updated rust_kernel.cpp to compile under g++
2011-07-13Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.Graydon Hoare-1/+1
2011-06-27Implementation mising features in lock_and_signal for Win32. Also lowered ↵Eric Holk-1/+2
the minimum stack size to get the pfib benchmark to run without exhausting its address space on Windows.
2011-06-27Basic multithreading support. The infinite loops test successfully maxes out ↵Eric Holk-0/+14
the CPU.
2010-09-10Added lock_and_signal::signal_all(), and made the rust_kernel::join() use ↵Michael Bebenita-0/+1
wait instead of yield.
2010-09-08Tidy up the sync dir, remove dead or mis-designed code in favour of OS ↵Graydon Hoare-0/+23
primitives, switch rust_kernel to use a lock/signal pair and wait rather than spin.