Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
smplock.h
Package: linux-2.4.20.tar.gz [view]
Upload User: jlfgdled
Upload Date: 2013-04-10
Package Size: 33168k
Code Size: 1k
Category:
Linux-Unix program
Development Platform:
Unix_Linux
- /*
- * <asm/smplock.h>
- *
- * Default SMP lock implementation
- *
- * 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.
- */
- #include <linux/interrupt.h>
- #include <linux/spinlock.h>
- extern spinlock_t kernel_flag;
- #define kernel_locked() spin_is_locked(&kernel_flag)
- /*
- * Release global kernel lock and global interrupt lock
- */
- #define release_kernel_lock(task, cpu)
- do {
- if (task->lock_depth >= 0)
- spin_unlock(&kernel_flag);
- release_irqlock(cpu);
- __sti();
- } while (0)
- /*
- * Re-acquire the kernel lock
- */
- #define reacquire_kernel_lock(task)
- do {
- if (task->lock_depth >= 0)
- spin_lock(&kernel_flag);
- } while (0)
- /*
- * Getting the big kernel lock.
- *
- * This cannot happen asynchronously,
- * so we only need to worry about other
- * CPU's.
- */
- static inline void lock_kernel(void)
- {
- if (!++current->lock_depth)
- spin_lock(&kernel_flag);
- }
- static inline void unlock_kernel(void)
- {
- if (--current->lock_depth < 0)
- spin_unlock(&kernel_flag);
- }