slightly faster path for port-commit-peeked with always-evt

svn: r2794
This commit is contained in:
Matthew Flatt 2006-04-26 12:55:01 +00:00
parent 1eee81ca66
commit 1ec48e2e83

View File

@ -1928,6 +1928,11 @@ int scheme_peeked_read_via_get(Scheme_Input_Port *ip,
/* No other thread is trying to commit. This one is hereby
elected "main" if multiple threads try to commit. */
if (SAME_TYPE(t, scheme_always_evt_type)) {
/* Fast path: always-evt is ready */
return complete_peeked_read_via_get(ip, size);
}
/* This sema makes other threads wait before reading: */
sema = scheme_make_sema(0);
ip->input_lock = sema;