mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Fixes <http://bugs.gnu.org/14404>. Thanks to Paul Eggert <eggert@cs.ucla.edu> for the suggestion. * m4/gnulib-cache.m4: Avoid 'lock' module. * m4/lock.m4, m4/threadlib.m4, lib/glthread/threadlib.c, lib/glthread/lock.c: Remove. * lib/glthread/lock.h: Rewrite in terms of libguile/threads.h. * m4/gnulib-common.m4, m4/gnulib-comp.m4, lib/Makefile.am, lib/unistd.in.h, maint.mk : Update, from Gnulib v0.1-92-g546ff82. * configure.ac (GNULIB_LOCK): Define 'GNULIB_LOCK'. Define 'USE_POSIX_THREADS' when building with pthread support. * Makefile.am (noinst_HEADERS): New variable. (BUILT_SOURCES): Add libguile/scmconfig.h. (libguile/scmconfig.h): New target.
38 lines
1.4 KiB
C
38 lines
1.4 KiB
C
#ifndef SCM_GLTHREADS_H
|
|
#define SCM_GLTHREADS_H
|
|
|
|
/* Copyright (C) 2014 Free Software Foundation, Inc.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
* as published by the Free Software Foundation; either version 3 of
|
|
* the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
* 02110-1301 USA
|
|
*/
|
|
|
|
/* This file implements Gnulib's glthreads/lock.h interface in terms of
|
|
Guile's locking API. This allows Gnulib modules such as 'regex' to
|
|
be built with thread-safety support via Guile's locks (see
|
|
<http://bugs.gnu.org/14404>.) */
|
|
|
|
#include <libguile/threads.h>
|
|
#include <stdlib.h>
|
|
|
|
#define gl_lock_define(klass, name) \
|
|
klass scm_i_pthread_mutex_t name;
|
|
|
|
#define glthread_lock_init(lock) scm_i_pthread_mutex_init ((lock), NULL)
|
|
#define glthread_lock_destroy scm_i_pthread_mutex_destroy
|
|
#define glthread_lock_lock scm_i_pthread_mutex_lock
|
|
#define glthread_lock_unlock scm_i_pthread_mutex_unlock
|
|
|
|
#endif
|