[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fix dependencies among thread modules
From: |
Bruno Haible |
Subject: |
fix dependencies among thread modules |
Date: |
Sat, 21 Dec 2019 13:45:49 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; ) |
The general structure of the multithreading modules in gnulib is that we have
three set of modules:
pthread-*, sched_yield : POSIX API
threads, threads-h, thrd, mtx, cnd, tss: ISO C API
threadlib, thread, lock, cond, tls, yield:
gnulib API, obeys --enable-threads configure option
They are independent, except for the fact that the *implementation* of the
second and third set may use the POSIX API.
There are currently two violations of this structure:
1) The threads-h modules should not depend on threadlib.
2) sched_yield should not depend on threadlib and yield.
It's the other way around: yield may depend on sched_yield.
These patches fixes them.
2019-12-21 Bruno Haible <address@hidden>
threads-h: Don't depend on threadlib.
* modules/threads-h (configure.ac-early): Invoke gl_ANYTHREADLIB_EARLY,
not gl_THREADLIB_EARLY.
2019-12-21 Bruno Haible <address@hidden>
sched_yield: Don't depend on threadlib and yield.
* m4/threadlib.m4 (gl_PTHREADLIB): Document that it sets
LIB_SCHED_YIELD.
(gl_PTHREADLIB_BODY): Set LIB_SCHED_YIELD (code moved here from
m4/yield.m4).
* m4/sched_yield.m4 (gl_FUNC_SCHED_YIELD): Require gl_PTHREADLIB, not
gl_THREADLIB and gl_YIELD.
* m4/yield.m4 (gl_YIELD): Require gl_PTHREADLIB. Determine YIELD_LIB
based on $(LIB_SCHED_YIELD).
* m4/threads.m4 (gl_THREADS_H): Don't require gl_YIELD. Use
$(LIB_SCHED_YIELD), not $(YIELD_LIB).
* modules/sched_yield (Files): Remove yield.m4. Add threadlib.m4.
(Depends-on): Remove threadlib.
(Link): Mention $(LIB_SCHED_YIELD), not $(YIELD_LIB).
* modules/threads-h (Files): Remove m4/yield.m4.
* modules/pthread-cond-tests (Makefile.am): Link the programs against
$(LIB_SCHED_YIELD), not $(YIELD_LIB).
* modules/pthread-mutex-tests (Makefile.am): Likewise.
* modules/pthread-once-tests (Makefile.am): Likewise.
* modules/pthread-rwlock-tests (Makefile.am): Likewise.
* modules/pthread-tss-tests (Makefile.am): Likewise.
0001-threads-h-Don-t-depend-on-threadlib.patch
Description: Text Data
0002-sched_yield-Don-t-depend-on-threadlib-and-yield.patch
Description: Text Data
- fix dependencies among thread modules,
Bruno Haible <=