⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gthreads.h

📁 T-kernel 的extension源代码
💻 H
字号:
/* *---------------------------------------------------------------------- *    T-Kernel / Standard Extension * *    Copyright (C) 2006 by Ken Sakamura. All rights reserved. *    T-Kernel / Standard Extension is distributed  *      under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * *    Version:   1.00.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* *	gthreads.h (libtkse) * *	Multi-thread support routine exclusive for "gcc" 's exclusive use * *	Call any of these through function pointer. *	"NULL" shall be set when the multi-thread-compliant is unnecessary. *//* * Once_block * Execute "init_routine" only once. * Assure the only initial one execution of "init_routine" even if it is called by many tasks. * Consider that "*once_block" is initialized to 0. * Return 0 when successful, or return negative value when unsuccessful. */extern int (*_thread_once)(long *once_block, void (*init_routine)());/* * Create the information specific to task * Store the key of the created specific information into "*keyp", and execute return. * Discard the specific information with "destructor" when task exits. * Return 0 when successful, or return negative value when unsuccessful. */extern int (*_thread_key_create)(long *keyp, void (*destructor)(void *));/*  * Store the task-specific information * Store the specific information "value" corresponding to the specific information "key". * Return 0 when successful, or return negative value when unsuccessful. */extern int (*_thread_key_set)(long key, void *value);/*  * Fetch the task-specific information * Store the specific information "value" corresponding to specific informartion "key". * Return 0 when successful, or return negative value when unsuccessful. */extern int (*_thread_key_get)(long key, void **valuep);/* * Lock "mutex" * Return 0 when successful, or return negative value when unsuccessful. */extern int (*_thread_mutex_lock)(long *mutex);/* * Unlock "mutex" * Return 0 when successful, or return negative value when unsuccessful. */extern int (*_thread_mutex_unlock)(long *mutex);/* * Initialize "mutex" * Return 0 when successful, or return negative value when unsuccessful. */extern int (*_thread_mutex_init)(long *mutex);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -