mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Updates and fixes to Mutex (#933)
Updating Mutex to have specific types: TimedMutex, RecursiveMutex, TimedRecursiveMutex. Fixes to the win32 implementation.
This commit is contained in:
committed by
GitHub
parent
8a4337e819
commit
e694d60f23
@@ -6,7 +6,7 @@ fn void! copy_map() @test
|
||||
{
|
||||
TrackingAllocator alloc;
|
||||
alloc.init(mem::heap());
|
||||
io::printfn("Heap mem: %d", alloc.allocated());
|
||||
assert(alloc.allocated() == 0);
|
||||
mem::@scoped(&alloc)
|
||||
{
|
||||
HashMap(<String, int>) x;
|
||||
|
||||
@@ -21,7 +21,7 @@ fn void! testrun_mutex() @test
|
||||
{
|
||||
Thread[100] ts;
|
||||
a = 0;
|
||||
m.init(thread::MUTEX_PLAIN)!;
|
||||
m.init()!;
|
||||
foreach (&t : ts)
|
||||
{
|
||||
t.create(fn int(void* arg) {
|
||||
@@ -60,7 +60,7 @@ fn void! testrun_mutex_try() @test
|
||||
|
||||
fn void! testrun_mutex_timeout() @test
|
||||
{
|
||||
Mutex m;
|
||||
TimedMutex m;
|
||||
m.init()!;
|
||||
m.lock()!;
|
||||
if (try m.lock_timeout(100))
|
||||
|
||||
Reference in New Issue
Block a user