emlxs_thread.c revision a9800beb32c1006bb21c8da39e0180ea440b7bad
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Emulex. All rights reserved.
* Use is subject to license terms.
*/
#include <emlxs.h>
/* Required for EMLXS_CONTEXT in EMLXS_MSGF calls */
static void
{
void (*func) ();
void *arg;
}
}
thread_exit();
return;
} /* emlxs_taskq_thread() */
{
/* Make sure taskq is open for business */
return (0);
}
/* Check get_list for a thread */
/* Get the next thread */
}
/* Else check put_list for a thread */
/* Move put_list to get_list */
/* Get the next thread */
}
/* Wake up the thread if one exists */
if (tthread) {
return (1);
}
return (0);
} /* emlxs_taskq_dispatch() */
void
{
char buf[64];
uint32_t i;
/* If taskq is already open then quit */
return;
}
/* Zero the taskq */
for (i = 0; i < EMLXS_MAX_TASKQ_THREADS; i++) {
}
/* Open the taskq */
return;
} /* emlxs_taskq_create() */
void
{
uint32_t i;
/* If taskq already closed, then quit */
return;
}
/* If taskq already closed, then quit */
return;
}
/* No more threads can be dispatched now */
/* Kill the threads */
for (i = 0; i < EMLXS_MAX_TASKQ_THREADS; i++) {
/*
* If the thread lock can be acquired,
* it is in one of these states:
* 1. Thread not started.
* 2. Thread asleep.
* 3. Thread busy.
* 4. Thread ended.
*/
/* Wait for thread to die */
}
/* Clean up thread */
}
/* Clean up taskq */
return;
} /* emlxs_taskq_destroy() */
static void
{
void (*func) ();
void *arg1;
void *arg2;
}
/* Remove the thread from the spawn thread list */
}
else
{
/*
* If the thread lock can be acquired,
* it is in one of these states:
* 1. Thread not started.
* 2. Thread asleep.
* 3. Thread busy.
* 4. Thread ended.
*/
}
}
}
}
thread_exit();
} /* emlxs_thread() */
void
{
char buf[64];
return;
}
} /* emlxs_thread_create() */
void
{
/*
* If the thread lock can be acquired,
* it is in one of these states:
* 1. Thread not started.
* 2. Thread asleep.
* 3. Thread busy.
* 4. Thread ended.
*/
return;
}
return;
}
/* Wait for thread to end */
}
return;
} /* emlxs_thread_destroy() */
void
{
/*
* If the thread lock can be acquired,
* it is in one of these states:
* 1. Thread not started.
* 2. Thread asleep.
* 3. Thread busy.
* 4. Thread ended.
*/
return;
}
return;
}
return;
}
}
}
return;
} /* emlxs_thread_trigger1() */
void
{
/*
* If the thread lock can be acquired,
* it is in one of these states:
* 1. Thread not started.
* 2. Thread asleep.
* 3. Thread busy.
* 4. Thread ended.
*/
return;
}
return;
}
return;
}
}
}
return;
} /* emlxs_thread_trigger2() */
void
{
/* Create a thread */
"Unable to allocate thread object.");
return;
}
/* Queue the thread on the spawn thread list */
/* Dont spawn the thread if the spawn list is closed */
if (hba->spawn_open == 0) {
/* destroy the thread */
return;
}
}
else
{
}
} /* emlxs_thread_spawn() */
void
{
if (hba->spawn_open) {
return;
}
}
void
{
if (hba->spawn_open == 0) {
return;
}
hba->spawn_open = 0;
}
/* Wait for all the spawned threads to complete */
while (hba->spawn_thread_head) {
}
}