2005-06-28 07:04:36 +04:00
|
|
|
/*
|
2010-10-20 07:00:38 +04:00
|
|
|
Copyright (c) 2004-2010 Jay Sorg
|
2007-02-07 06:37:26 +03:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included
|
|
|
|
in all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
thread calls
|
2005-06-28 07:04:36 +04:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if !defined(THREAD_CALLS_H)
|
|
|
|
#define THREAD_CALLS_H
|
|
|
|
|
2006-11-05 01:05:06 +03:00
|
|
|
#include "arch.h"
|
|
|
|
|
2005-12-14 04:18:06 +03:00
|
|
|
int APP_CC
|
2007-02-03 09:17:24 +03:00
|
|
|
tc_thread_create(THREAD_RV (THREAD_CC * start_routine)(void*), void* arg);
|
2007-11-03 10:18:48 +03:00
|
|
|
tbus APP_CC
|
2007-02-03 09:17:24 +03:00
|
|
|
tc_get_threadid(void);
|
2008-08-13 11:44:00 +04:00
|
|
|
int APP_CC
|
|
|
|
tc_threadid_equal(tbus tid1, tbus tid2);
|
2007-11-03 10:18:48 +03:00
|
|
|
tbus APP_CC
|
2007-02-04 10:54:23 +03:00
|
|
|
tc_mutex_create(void);
|
2007-02-03 09:17:24 +03:00
|
|
|
void APP_CC
|
2007-11-03 10:18:48 +03:00
|
|
|
tc_mutex_delete(tbus mutex);
|
2007-02-03 09:17:24 +03:00
|
|
|
int APP_CC
|
2007-11-03 10:18:48 +03:00
|
|
|
tc_mutex_lock(tbus mutex);
|
2007-02-03 09:17:24 +03:00
|
|
|
int APP_CC
|
2007-11-03 10:18:48 +03:00
|
|
|
tc_mutex_unlock(tbus mutex);
|
|
|
|
tbus APP_CC
|
2007-02-04 10:54:23 +03:00
|
|
|
tc_sem_create(int init_count);
|
|
|
|
void APP_CC
|
2007-11-03 10:18:48 +03:00
|
|
|
tc_sem_delete(tbus sem);
|
2007-02-04 10:54:23 +03:00
|
|
|
int APP_CC
|
2007-11-03 10:18:48 +03:00
|
|
|
tc_sem_dec(tbus sem);
|
2007-02-04 10:54:23 +03:00
|
|
|
int APP_CC
|
2007-11-03 10:18:48 +03:00
|
|
|
tc_sem_inc(tbus sem);
|
2005-06-28 07:04:36 +04:00
|
|
|
|
|
|
|
#endif
|