-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This enables the fiber-safe `Mutex` on Windows and removes the stub implementation. It is mostly unrelated to [`Thread::Mutex`](#11647). The standard library uses `Mutex` in `Log::SyncDispatcher`; it does not seem to break. (On the other hand, the specs for `Log::AsyncDispatcher` require non-blocking pipes, which are not available yet.)
- Loading branch information
1 parent
305f081
commit c19df0b
Showing
4 changed files
with
3 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,3 @@ | ||
require "c/synchapi" | ||
|
||
class Mutex | ||
enum Protection | ||
Checked | ||
Reentrant | ||
Unchecked | ||
end | ||
|
||
def initialize(@protection : Protection = :checked) | ||
end | ||
|
||
def lock | ||
end | ||
|
||
def unlock | ||
end | ||
|
||
def synchronize | ||
lock | ||
begin | ||
yield | ||
ensure | ||
unlock | ||
end | ||
end | ||
end | ||
|
||
enum Signal | ||
KILL = 0 | ||
end |