📄 semaphore.h
字号:
/* * semaphore.h * * Copyright (C) 2006 Insigme Co., Ltd * * Authors: * - Liwei Zhou * * This software has been developed while working on the Linux Unified Kernel * project (http://linux.insigma.com.cn) in the Insigma Reaserch Institute, * which is a subdivision of Insigma Co., Ltd (http://www.insigma.com.cn). * * The project is sponsored by Insigma Co., Ltd. * * The authors can be reached at linux@insigma.com.cn. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * Revision History: * Jan 2006 - Created. */ /* * semaphore.h: win32 semaphore definition * Reference to Kernel-win32 code */#ifndef _SEMAPHORE_H#define _SEMAPHORE_H#include <linux/module.h>#include "object.h"#ifdef CONFIG_UNIFIED_KERNEL/* * semaphore object definition * - do not modify wm_count unless holding wm_lock */struct win32_semaphore { spinlock_t ws_lock; /* count modification lock */ long ws_count; /* semaphore count */ long ws_max; /* maximum count */};struct sema_args { PHANDLE SemaphoreHandle; ACCESS_MASK DesiredAccess; POBJECT_ATTRIBUTES ObjectAttributes; LONG InitialCount; LONG MaximumCount;};extern void SemaphoreClassInit(void);NTSTATUS STDCALLNtCreateSemaphore(OUT PHANDLE SemaphoreHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN LONG InitialCount, IN LONG MaximumCount);NTSTATUS STDCALLNtOpenSemaphore(OUT PHANDLE SemaphoreHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes);NTSTATUS STDCALLNtReleaseSemaphore(IN HANDLE SemaphoreHandle, IN LONG ReleaseCount, OUT PLONG PreviousCount OPTIONAL);#endif /* CONFIG_UNIFIED_KERNEL */#endif /* _SEMAPHORE_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -