#include "pgrx-cshim-static.c"
void SpinLockInit__pgrx_cshim(volatile slock_t *lock) {
SpinLockInit(lock);
}
void SpinLockAcquire__pgrx_cshim(volatile slock_t *lock) {
SpinLockAcquire(lock);
}
void SpinLockRelease__pgrx_cshim(volatile slock_t *lock) {
SpinLockRelease(lock);
}
bool SpinLockFree__pgrx_cshim(slock_t *lock) {
return SpinLockFree(lock);
}
int call_closure_with_sigsetjmp(int savemask, void* closure_env_ptr, int (*closure_code)(sigjmp_buf jbuf, void *env_ptr)) {
sigjmp_buf jbuf;
int val;
if (0 == (val = sigsetjmp(jbuf, savemask))) {
return closure_code(jbuf, closure_env_ptr);
} else {
return val;
}
}