Skip to content

Commit 4c3d4c6

Browse files
committed
rename sem_post/sem_wait
1 parent 4de9724 commit 4c3d4c6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ltask.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ mainthread_current(struct mainthread_session *mt, service_id id) {
7979

8080
static inline void
8181
mainthread_trigger(struct mainthread_session *mt) {
82-
sem_release(&mt->ev);
82+
sem_post(&mt->ev);
8383
}
8484

8585
struct ltask {
@@ -1156,7 +1156,7 @@ lmainthread_wait(lua_State *L) {
11561156
int inf = !lua_toboolean(L, 1);
11571157
int finish = 0;
11581158
do {
1159-
if (sem_acquire(&mt->ev, inf)) {
1159+
if (sem_wait(&mt->ev, inf)) {
11601160
lua_pushboolean(L, 1); // fail
11611161
return 1;
11621162
}

src/semaphore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ sem_deinit(struct sem *s) {
1818
}
1919

2020
static inline int
21-
sem_acquire(struct sem *s, int inf) {
21+
sem_wait(struct sem *s, int inf) {
2222
// ignore inf, always wait inf
2323
cond_wait_begin(&s->c);
2424
cond_wait(&s->c);
@@ -28,7 +28,7 @@ sem_acquire(struct sem *s, int inf) {
2828
}
2929

3030
static inline void
31-
sem_release(struct sem *s) {
31+
sem_post(struct sem *s) {
3232
cond_trigger_begin(&s->c);
3333
cond_trigger_end(&s->c, 1);
3434
}

0 commit comments

Comments
 (0)