Import Upstream version 20180207
[hcoop/debian/mlton.git] / runtime / gc / atomic.c
CommitLineData
7f918cf1
CE
1/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 */
8
9void beginAtomic (GC_state s) {
10 s->atomicState++;
11 if (0 == s->limit)
12 s->limit = s->limitPlusSlop - GC_HEAP_LIMIT_SLOP;
13}
14
15void endAtomic (GC_state s) {
16 s->atomicState--;
17 if (0 == s->atomicState
18 and s->signalsInfo.signalIsPending)
19 s->limit = 0;
20}