diff options
author | hemagx <hemagx2@gmail.com> | 2016-02-17 15:29:36 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-07-12 20:58:36 +0200 |
commit | 909b9d35ff9bdaaac784cf88f669eea0982fdd58 (patch) | |
tree | ab82dbcd0b448f20e3787cf2e5f34758327f7e1e /src/common/console.c | |
parent | 591e877c7f30d4c9d34b996f245b0ad0ee81c46d (diff) | |
download | hercules-909b9d35ff9bdaaac784cf88f669eea0982fdd58.tar.gz hercules-909b9d35ff9bdaaac784cf88f669eea0982fdd58.tar.bz2 hercules-909b9d35ff9bdaaac784cf88f669eea0982fdd58.tar.xz hercules-909b9d35ff9bdaaac784cf88f669eea0982fdd58.zip |
Interface mutex.c
Diffstat (limited to 'src/common/console.c')
-rw-r--r-- | src/common/console.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/common/console.c b/src/common/console.c index 0be33e5c3..bca9f36aa 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team + * Copyright (C) 2012-2016 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify @@ -475,9 +475,9 @@ void *cThread_main(void *x) { LeaveSpinLock(&console->input->ptlock); } } - ramutex_lock( console->input->ptmutex ); - racond_wait( console->input->ptcond, console->input->ptmutex, -1 ); - ramutex_unlock( console->input->ptmutex ); + mutex->lock(console->input->ptmutex); + mutex->cond_wait(console->input->ptcond, console->input->ptmutex, -1); + mutex->unlock(console->input->ptmutex); } return NULL; @@ -490,19 +490,19 @@ int console_parse_timer(int tid, int64 tick, int id, intptr_t data) { } cinput.count = 0; LeaveSpinLock(&console->input->ptlock); - racond_signal(console->input->ptcond); + mutex->cond_signal(console->input->ptcond); return 0; } void console_parse_final(void) { if( console->input->ptstate ) { InterlockedDecrement(&console->input->ptstate); - racond_signal(console->input->ptcond); + mutex->cond_signal(console->input->ptcond); /* wait for thread to close */ rathread_wait(console->input->pthread, NULL); - racond_destroy(console->input->ptcond); - ramutex_destroy(console->input->ptmutex); + mutex->cond_destroy(console->input->ptcond); + mutex->destroy(console->input->ptmutex); } } void console_parse_init(void) { @@ -512,8 +512,8 @@ void console_parse_init(void) { InitializeSpinLock(&console->input->ptlock); - console->input->ptmutex = ramutex_create(); - console->input->ptcond = racond_create(); + console->input->ptmutex = mutex->create(); + console->input->ptcond = mutex->cond_create(); if( (console->input->pthread = rathread_create(console->input->pthread_main, NULL)) == NULL ){ ShowFatalError("console_parse_init: failed to spawn console_parse thread.\n"); |