mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-07 04:30:18 +02:00
Add API to inihibit pre-emption
This is really only for BDW. It uses GC_alloc_lock() / GC_alloc_unlock().
This commit is contained in:
parent
cc2a90b494
commit
d58aa71281
5 changed files with 28 additions and 0 deletions
13
api/gc-api.h
13
api/gc-api.h
|
@ -301,4 +301,17 @@ static inline void gc_safepoint(struct gc_mutator *mut) {
|
|||
gc_safepoint_slow(mut);
|
||||
}
|
||||
|
||||
GC_API_ void gc_safepoint_signal_inhibit(struct gc_mutator *mut);
|
||||
GC_API_ void gc_safepoint_signal_reallow(struct gc_mutator *mut);
|
||||
|
||||
static inline void gc_inhibit_preemption(struct gc_mutator *mut) {
|
||||
if (gc_safepoint_mechanism() == GC_SAFEPOINT_MECHANISM_SIGNAL)
|
||||
gc_safepoint_signal_inhibit(mut);
|
||||
}
|
||||
|
||||
static inline void gc_reallow_preemption(struct gc_mutator *mut) {
|
||||
if (gc_safepoint_mechanism() == GC_SAFEPOINT_MECHANISM_SIGNAL)
|
||||
gc_safepoint_signal_reallow(mut);
|
||||
}
|
||||
|
||||
#endif // GC_API_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue