/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#include "asohdr.h"
#else
#define SPIN 1000000
typedef union Semun_u
{
int val;
unsigned short* array;
} Semun_t;
typedef struct APL_s
{
int id;
} APL_t;
static void*
{
char* path;
char* opt;
size_t n;
int key;
int id;
int perm;
char tmp[64];
if (apl)
{
/*
* semaphore 0 is the reference count
* the id is dropped on last reference
*/
return 0;
}
size = 128;
{
{
n = sizeof(tmp) - 1;
tmp[n] = 0;
}
{
if (size <= 1)
return 0;
}
}
for (;;)
{
{
/*
* initialize all semaphores to 0
* this also sets the semaphore 0 ref count
*/
{
return 0;
}
break;
}
size /= 2;
return 0;
{
unsigned int k;
/*
* make sure all semaphores have been activated
*/
{
return 0;
break;
}
if (k > SPIN)
return 0;
/*
* bump the ref count
*/
return 0;
break;
}
size /= 2;
else
return 0;
}
return 0;
return apl;
}
static ssize_t
{
if (!apl)
return -1;
if (k > 0)
else
{
}
}
Asometh_t _aso_meth_semaphore = { "semaphore", ASO_PROCESS|ASO_THREAD, aso_init_semaphore, aso_lock_semaphore };
#endif