/[guile]/guile/guile-core/libguile/threads.h
ViewVC logotype

Diff of /guile/guile-core/libguile/threads.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by mvo, Wed Oct 16 15:57:13 2002 UTC revision 1.23 by mvo, Sun Oct 27 20:12:37 2002 UTC
# Line 71  SCM_API scm_t_bits scm_tc16_condvar; Line 71  SCM_API scm_t_bits scm_tc16_condvar;
71  SCM_API void scm_threads_init (SCM_STACKITEM *);  SCM_API void scm_threads_init (SCM_STACKITEM *);
72  SCM_API void scm_threads_mark_stacks (void);  SCM_API void scm_threads_mark_stacks (void);
73  SCM_API void scm_init_threads (SCM_STACKITEM *);  SCM_API void scm_init_threads (SCM_STACKITEM *);
74    SCM_API void scm_init_thread_procs (void);
 /* */  
 SCM_API SCM scm_threads_make_mutex (void);  
 SCM_API SCM scm_threads_lock_mutex (SCM);  
 SCM_API SCM scm_threads_unlock_mutex (SCM);  
 SCM_API SCM scm_threads_monitor (void);  
75    
76  SCM_API SCM scm_spawn_thread (scm_t_catch_body body, void *body_data,  SCM_API SCM scm_spawn_thread (scm_t_catch_body body, void *body_data,
77                                scm_t_catch_handler handler, void *handler_data);                                scm_t_catch_handler handler, void *handler_data);
# Line 96  SCM_API SCM scm_call_with_new_thread (SC Line 91  SCM_API SCM scm_call_with_new_thread (SC
91  SCM_API SCM scm_join_thread (SCM t);  SCM_API SCM scm_join_thread (SCM t);
92  SCM_API SCM scm_make_mutex (void);  SCM_API SCM scm_make_mutex (void);
93  SCM_API SCM scm_lock_mutex (SCM m);  SCM_API SCM scm_lock_mutex (SCM m);
94    SCM_API SCM scm_try_mutex (SCM m);
95  SCM_API SCM scm_unlock_mutex (SCM m);  SCM_API SCM scm_unlock_mutex (SCM m);
96  SCM_API SCM scm_make_condition_variable (void);  SCM_API SCM scm_make_condition_variable (void);
97  SCM_API SCM scm_wait_condition_variable (SCM cond, SCM mutex);  SCM_API SCM scm_wait_condition_variable (SCM cond, SCM mutex);
98    SCM_API SCM scm_timed_wait_condition_variable (SCM cond, SCM mutex,
99                                                   SCM abstime);
100  SCM_API SCM scm_signal_condition_variable (SCM cond);  SCM_API SCM scm_signal_condition_variable (SCM cond);
101    SCM_API SCM scm_broadcast_condition_variable (SCM cond);
102    
103  SCM_API SCM scm_current_thread (void);  SCM_API SCM scm_current_thread (void);
104  SCM_API SCM scm_all_threads (void);  SCM_API SCM scm_all_threads (void);
105    
106    SCM_API int scm_c_thread_exited_p (SCM thread);
107    SCM_API SCM scm_thread_exited_p (SCM thread);
108    
109  SCM_API scm_root_state *scm_i_thread_root (SCM thread);  SCM_API scm_root_state *scm_i_thread_root (SCM thread);
110    
111    #ifndef HAVE_STRUCT_TIMESPEC
112    /* POSIX.4 structure for a time value.  This is like a `struct timeval' but
113       has nanoseconds instead of microseconds.  */
114    struct timespec
115    {
116      long int tv_sec;              /* Seconds.  */
117      long int tv_nsec;             /* Nanoseconds.  */
118    };
119    #endif
120    
121  #ifdef USE_COOP_THREADS  #ifdef USE_COOP_THREADS
122  #include "libguile/coop-defs.h"  #include "libguile/coop-defs.h"
123  #else  #else
124    #ifdef USE_COPT_THREADS
125    #include "libguile/coop-pthreads.h"
126    #else
127  #include "libguile/null-threads.h"  #include "libguile/null-threads.h"
128  #endif  #endif
129    #endif
130    
131    #if (SCM_ENABLE_DEPRECATED == 1)
132    
133    typedef struct {
134      SCM m;
135    } scm_t_mutex;
136    
137    SCM_API int scm_mutex_init (scm_t_mutex *m);
138    SCM_API int scm_mutex_lock (scm_t_mutex *m);
139    SCM_API int scm_mutex_trylock (scm_t_mutex *m);
140    SCM_API int scm_mutex_unlock (scm_t_mutex *m);
141    SCM_API int scm_mutex_destroy (scm_t_mutex *m);
142    
143    typedef struct {
144      SCM c;
145    } scm_t_cond;
146    
147    SCM_API int scm_cond_init (scm_t_cond *c);
148    SCM_API int scm_cond_wait (scm_t_cond *c, scm_t_mutex *m);
149    SCM_API int scm_cond_timedwait (scm_t_cond *c, scm_t_mutex *m,
150                                    const struct timespec *abstime);
151    SCM_API int scm_cond_signal (scm_t_cond *c);
152    SCM_API int scm_cond_broadcast (scm_t_cond *c);
153    SCM_API int scm_cond_destroy (scm_t_cond *c);
154    
155    #endif /* SCM_ENABLE_DEPRECATED == 1 */
156    
157  #endif  /* SCM_THREADS_H */  #endif  /* SCM_THREADS_H */
158    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26