-
Notifications
You must be signed in to change notification settings - Fork 987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutexes and condition variables with names #380
Conversation
Now `make-mutex` and `make-condition` accept an optional argument name, which must be a symbol. When the mutex or condition is printed, the name is also printed. The name is immutable and can be accessed by mutex-name and condition-name.
This looks good to me, thanks! Please add an entry to LOG. If you feel like updating the release notes and the user's guide as well, go ahead, or I'll make the changes after pulling the changes. |
Added entries to LOG and release notes and updated CSUG. |
LOG
Outdated
- add name fields for mutexes and condition variables, now `make-mutex` and | ||
`make-condition` accept an optional argument `name`, which must be a | ||
symbol. The name is printed every time the object is printed, which is | ||
usefull for debugging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usefull => useful
csug/threads.stex
Outdated
\returns a new mutex object | ||
\listlibraries | ||
\endnoskipentryheader | ||
|
||
\noindent | ||
\var{name}, if supplied, must be a symbol which identifies the mutex. The | ||
name is printed every time the mutex is printed, which is usefull for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useful
csug/threads.stex
Outdated
\noindent | ||
\var{name}, if supplied, must be a symbol which identifies the condition | ||
object. The name is printed every time the condition is printed, which is | ||
usefull for debugging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useful
release_notes/release_notes.stex
Outdated
The procedures \scheme{make-mutex} and \scheme{make-condition} now | ||
accept an optional argument \scheme{name}, which must be a symbol | ||
that identifies the object. The name is printed every time the mutex | ||
or condition object is printed, which is usefull for debugging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useful
s/prims.ss
Outdated
m)] | ||
[(name) | ||
(unless (symbol? name) | ||
($oops 'make-condition "~s is not a symbol" name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be indented 1 more space
s/prims.ss
Outdated
c)] | ||
[(name) | ||
(unless (symbol? name) | ||
($oops 'make-condition "~s is not a symbol" name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be indented 1 more space
What do you think of allowing #f for the optional second argument of make-mutex and make-condition? This would make the definitions of the single-argument cases simpler and make it easier to write functions that take an optional name. |
That's probably a good idea. I don't see how it simplifies the single-argument cases, however. In fact, they would need to explicitly allow |
@jessymilare, if you use |
For the single argument cases, I meant that one could simply call the two-argument case with #f and wouldn't need to duplicate the body. |
Ah, I guess you mean the zero-argument cases. Yes, but that would send the zero-argument case through an unnecessary check. Although if one the zero-argument case calls the one-argument case, the |
Also fix some typos and indentation.
Thanks, I got my argument counts off by one! Yes, a helper without checks that is used by both front doors would be a good way to implement it. |
Sorry for the polution in the commits. I use aggressive-indent-mode and I forgot to disable it before editing. If the code is OK, I can recreate the commits or create one single commit for all changes. |
The build system found an error while building the threaded versions of Chez Scheme: Details Warning: undeclared variable assignment to $make-mutex at line 1485, char 1 of prims.ss |
Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's almost ready!
release_notes/release_notes.stex
Outdated
|
||
The procedures \scheme{make-mutex} and \scheme{make-condition} now | ||
accept an optional argument \scheme{name}, which must be a symbol | ||
that identifies the object. The name is printed every time the mutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or \scheme{#f} for no name
Thank you for this pull request! |
add name fields for mutexes and condition variables, now `make-mutex` and `make-condition` accept an optional argument `name`, which must be a symbol or #f. The name, if not #f, is printed every time the object is printed, which is useful for debugging.
add name fields for mutexes and condition variables, now `make-mutex` and `make-condition` accept an optional argument `name`, which must be a symbol or #f. The name, if not #f, is printed every time the object is printed, which is useful for debugging. Original commit: 1397e17
add name fields for mutexes and condition variables, now `make-mutex` and `make-condition` accept an optional argument `name`, which must be a symbol or #f. The name, if not #f, is printed every time the object is printed, which is useful for debugging. Original commit: 1397e17
Related to issue 372
Now
make-mutex
andmake-condition
accept an optionalargument name, which must be a symbol. When the mutex or
condition is printed, the name is also printed. The name
is immutable and can be accessed by mutex-name and
condition-name.
#372