summaryrefslogtreecommitdiffstats
path: root/sys/lockstack.h
blob: f41f9dcfdafd4a776c12e742eccd0899c792ead2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef _JOVE_SYS_LOCKSTACK_H
#define _JOVE_SYS_LOCKSTACK_H 1

#include <stddef.h>
#include "hal/obj.h"
#include "config.h"

typedef struct lockstack
{
    size_t depth;
    jove_owned_obj_t *stack[LOCKSTACK_MAX];
} lockstack_t;

jove_owned_obj_t *lockstack_push(lockstack_t *stack, jove_owned_obj_t *obj);
jove_obj_t *lockstack_pop(lockstack_t *stack);
void lockstack_popall(lockstack_t *stack);

#endif