Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10300 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2002/03, Thomas Kurschel. All rights reserved.
|
* Copyright 2002/03, Thomas Kurschel. All rights reserved.
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Deadlock-safe allocation of locked memory.
|
Deadlock-safe allocation of locked memory.
|
||||||
@@ -405,7 +405,7 @@ create_pool(int block_size, int alignment, int next_ofs,
|
|||||||
{
|
{
|
||||||
locked_pool *pool;
|
locked_pool *pool;
|
||||||
status_t res;
|
status_t res;
|
||||||
|
|
||||||
TRACE(("create_pool()\n"));
|
TRACE(("create_pool()\n"));
|
||||||
|
|
||||||
pool = (locked_pool *)malloc(sizeof(*pool));
|
pool = (locked_pool *)malloc(sizeof(*pool));
|
||||||
@@ -480,8 +480,10 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// public: destroy pool
|
/** public: destroy pool */
|
||||||
static void destroy_pool( locked_pool *pool )
|
|
||||||
|
static void
|
||||||
|
destroy_pool(locked_pool *pool)
|
||||||
{
|
{
|
||||||
TRACE(("destroy_pool()\n"));
|
TRACE(("destroy_pool()\n"));
|
||||||
|
|
||||||
@@ -509,17 +511,17 @@ init_locked_pool(void)
|
|||||||
{
|
{
|
||||||
status_t res;
|
status_t res;
|
||||||
|
|
||||||
if ((res = benaphore_init(&locked_pool_ben, "locked_pool_global_list")) < 0)
|
if ((res = benaphore_init(&locked_pool_ben, "locked_pool_global_list")) < B_OK)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if ((res = locked_pool_enlarger_sem = create_sem(0, "locked_pool_enlarger")) < 0)
|
if ((res = locked_pool_enlarger_sem = create_sem(0, "locked_pool_enlarger")) < B_OK)
|
||||||
goto err2;
|
goto err2;
|
||||||
|
|
||||||
locked_pools = NULL;
|
locked_pools = NULL;
|
||||||
locked_pool_shutting_down = false;
|
locked_pool_shutting_down = false;
|
||||||
|
|
||||||
if ((res = locked_pool_enlarger_thread = spawn_kernel_thread(enlarger_threadproc,
|
if ((res = locked_pool_enlarger_thread = spawn_kernel_thread(enlarger_threadproc,
|
||||||
"locked_pool_enlarger", B_NORMAL_PRIORITY, NULL)) < 0)
|
"locked_pool_enlarger", B_NORMAL_PRIORITY, NULL)) < B_OK)
|
||||||
goto err3;
|
goto err3;
|
||||||
|
|
||||||
resume_thread(locked_pool_enlarger_thread);
|
resume_thread(locked_pool_enlarger_thread);
|
||||||
@@ -538,7 +540,7 @@ err:
|
|||||||
/** global uninit, executed before module is unloaded */
|
/** global uninit, executed before module is unloaded */
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
uninit_locked_pool()
|
uninit_locked_pool(void)
|
||||||
{
|
{
|
||||||
int32 retcode;
|
int32 retcode;
|
||||||
locked_pool_shutting_down = true;
|
locked_pool_shutting_down = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user