[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: checkin of glthread/glcond modules
From: |
Bruno Haible |
Subject: |
Re: checkin of glthread/glcond modules |
Date: |
Sun, 17 Aug 2008 21:17:51 +0200 |
User-agent: |
KMail/1.5.4 |
Some more changes in the 'thread' module:
- glthread_create must return ENOSYS if no multithreading is available,
- gl_thread_create calling convention: it should better simply return the
created thread.
*** lib/glthread/thread.h.orig 2008-08-17 21:17:32.000000000 +0200
--- lib/glthread/thread.h 2008-08-17 21:17:24.000000000 +0200
***************
*** 24,30 ****
Thread data type: gl_thread_t.
Creating a thread:
! gl_thread_create (thread, func, arg);
Or with control of error handling:
err = glthread_create (&thread, func, arg);
extern int glthread_create (gl_thread_t *result,
--- 24,30 ----
Thread data type: gl_thread_t.
Creating a thread:
! thread = gl_thread_create (func, arg);
Or with control of error handling:
err = glthread_create (&thread, func, arg);
extern int glthread_create (gl_thread_t *result,
***************
*** 260,266 ****
/* Provide dummy implementation if threads are not supported. */
typedef int gl_thread_t;
! # define glthread_create(THREADP, FUNC, ARG) 0
# define glthread_sigmask(HOW, SET, OSET) 0
# define glthread_join(THREAD, RETVALP) 0
# define gl_thread_self() NULL
--- 260,266 ----
/* Provide dummy implementation if threads are not supported. */
typedef int gl_thread_t;
! # define glthread_create(THREADP, FUNC, ARG) ENOSYS
# define glthread_sigmask(HOW, SET, OSET) 0
# define glthread_join(THREAD, RETVALP) 0
# define gl_thread_self() NULL
***************
*** 274,293 ****
/* Macros with built-in error handling. */
! static inline int
! gl_thread_create_func (gl_thread_t * thread,
! void *(*func) (void *arg),
! void *arg)
{
int ret;
! ret = glthread_create (thread, func, arg);
if (ret != 0)
abort ();
! return ret;
}
- #define gl_thread_create(THREAD, FUNC, ARG) \
- gl_thread_create_func (&THREAD, FUNC, ARG)
#define gl_thread_sigmask(HOW, SET, OSET) \
do \
{ \
--- 274,290 ----
/* Macros with built-in error handling. */
! static inline gl_thread_t
! gl_thread_create (void *(*func) (void *arg), void *arg)
{
+ gl_thread_t thread;
int ret;
! ret = glthread_create (&thread, func, arg);
if (ret != 0)
abort ();
! return thread;
}
#define gl_thread_sigmask(HOW, SET, OSET) \
do \
{ \
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/13
- Re: checkin of glthread/glcond modules, Yoann Vandoorselaere, 2008/08/13
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/14
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/17
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/17
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/17
- Re: checkin of glthread/glcond modules,
Bruno Haible <=
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/17
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/18
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/17
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/17
- Re: checkin of glthread/glcond modules, Bruno Haible, 2008/08/17