haiku/headers/private/media/PortPool.h
ejakowatz 52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00

38 lines
677 B
C++

/***********************************************************************
* Copyright (c) 2002 Marcus Overhagen. All Rights Reserved.
* This file may be used under the terms of the OpenBeOS License.
*
* A pool of kernel ports
***********************************************************************/
#ifndef _POOL_PORT_H_
#define _POOL_PORT_H_
class PortPool
{
public:
PortPool();
~PortPool();
port_id GetPort();
void PutPort(port_id port);
private:
void Lock();
void Unlock();
struct PortInfo
{
port_id port;
bool used;
};
PortInfo * pool;
int count;
int maxcount;
int32 locker_atom;
sem_id locker_sem;
};
extern PortPool *_PortPool;
#endif