summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-09-26 23:18:25 +0200
committerLudovic Courtès <ludo@gnu.org>2008-09-26 23:18:25 +0200
commit2956b07140da269fada704dab16d99cfd81f7d0a (patch)
tree688f856cde1fc812e566323e4c245b6dcf52c216
parent8c2b314350fb1926586922549ef53744ce6ea862 (diff)
downloadguile-2956b07140da269fada704dab16d99cfd81f7d0a.tar.gz
Don't use `scm_leave_guile ()' in mutex/cond-related procedures.
* libguile/threads.c (scm_pthread_mutex_lock, scm_pthread_cond_wait, scm_pthread_cond_timedwait): Don't call `scm_{leave,enter}_guile ()'.
-rw-r--r--libguile/threads.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libguile/threads.c b/libguile/threads.c
index 3b7902019..743314e14 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -1807,12 +1807,16 @@ scm_std_select (int nfds,
#if SCM_USE_PTHREAD_THREADS
+/* It seems reasonable to not run procedures related to mutex and condition
+ variables within `GC_do_blocking ()' since, (i) the GC can operate even
+ without it, and (ii) the only potential gain would be GC latency. See
+ http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/2245/focus=2251
+ for a discussion of the pros and cons. */
+
int
scm_pthread_mutex_lock (scm_i_pthread_mutex_t *mutex)
{
- scm_t_guile_ticket t = scm_leave_guile ();
int res = scm_i_pthread_mutex_lock (mutex);
- scm_enter_guile (t);
return res;
}
@@ -1832,9 +1836,7 @@ scm_dynwind_pthread_mutex_lock (scm_i_pthread_mutex_t *mutex)
int
scm_pthread_cond_wait (scm_i_pthread_cond_t *cond, scm_i_pthread_mutex_t *mutex)
{
- scm_t_guile_ticket t = scm_leave_guile ();
int res = scm_i_pthread_cond_wait (cond, mutex);
- scm_enter_guile (t);
return res;
}
@@ -1843,9 +1845,7 @@ scm_pthread_cond_timedwait (scm_i_pthread_cond_t *cond,
scm_i_pthread_mutex_t *mutex,
const scm_t_timespec *wt)
{
- scm_t_guile_ticket t = scm_leave_guile ();
int res = scm_i_pthread_cond_timedwait (cond, mutex, wt);
- scm_enter_guile (t);
return res;
}