Re: Mac OS 10.4 (Tiger) compilation errors ( GCC v3.3 ) with X Code 2.0 tool
Re: Mac OS 10.4 (Tiger) compilation errors ( GCC v3.3 ) with X Code 2.0 tool
- Subject: Re: Mac OS 10.4 (Tiger) compilation errors ( GCC v3.3 ) with X Code 2.0 tool
- From: Karunakar Reddy G <email@hidden>
- Date: Tue, 19 Jul 2005 10:03:04 +0530
Hi Quinn,
Once again thank you for your reply.
Basically I am using for creating a task and killing a task,
For creating a Task, first I create a thread using IOCreateThread, then I bind the thread using thread_bind(),
For killing a task, I kill current running tasks using thread_terminate_self()
One more thing, functions thread_bind() and thread_terminate_self() are defined in header files in old developer kit ( April2002Dev.tools).But these functions are removed in Xcode 2.0 developer tools
Traced in this path: System/Library/Frameworks/Kernel.Framework/Versions/A/Headers
Is there any alternate way to handle using KPIs, instead of using these functions?
it looks like this
-----------------------
struct rapi_task {
HEAP_HDR
char name[4];
DWORD priority;
DWORD args[4];
START_FUNC start_addr;
thread_t thread;
};
Creating a Task
----------------
DWORD xt_start(
DWORD
tid,
DWORD mode,
START_FUNC start_addr,
DWORD args[4]
)
{
struct rapi_task *k = (struct rapi_task *)tid;
thread_t thread;
if (!is_valid(k, TASK_TYPE)) {
return FAILURE;
}
k->start_addr = start_addr;
memcpy(k->args,args,sizeof(k->args));
thread = IOCreateThread(start_fn,k);
if (!thread) {
WARN(("IOCreateThread failed\n"));
free_obj(k);
return FAILURE;
}
thread_bind(thread,master_processor);
k->thread = thread;
return SUCCESS;
}
Killing a task
---------------
void rapi_kill_task(void)
{
thread_t thread = current_thread();
struct rapi_task *k;
if ((k = find_task(thread)) != NULL) {
DBG(1,("kill %.4s,thread=%p,running_tasks=%ld\n",k->name,k->thread,running_tasks));
OSDecrementAtomic(&running_tasks);
k->thread = NULL;
thread_terminate_self();
} else {
WARN(("thread=%p not rAPI task\n",thread));
}
}
static void start_fn(void *arg)
{
struct rapi_task *k = (struct rapi_task *)arg;
if (!is_valid(k, TASK_TYPE)) {
return;
}
if (!k->start_addr) {
return;
}
OSIncrementAtomic(&running_tasks);
DBG(1,("start %.4s,thread=%p,running_tasks=%ld\n",k->name,k->thread,running_tasks));
k->start_addr(k->args[0], k->args[1], k->args[2], k->args[3]);
OSDecrementAtomic(&running_tasks);
DBG(1,("start %.4s,thread=%p,running_tasks=%ld\n",k->name,k->thread,running_tasks));
k->thread = 0;
}
Compilation errors:
--------------------
1. error: 'thread_terminate_self' undeclared
2. error: 'master_process' undeclared
3. error: 'thread_bind' undeclared
I hope, the details are clear, could any body help me >>>?
Thanks in advance,
Regards,
Karunakar
On 7/18/05, Quinn <email@hidden> wrote:
At 15:25 +0530 18/7/05, Karunakar Reddy G wrote:
>I am facing serious problem with thread functions,
>I can compile on Mac OS 10.1.3 , gcc v 2.9 but not on 10.4.
>using this thread functions
>
>1) thread_bind( )
>2) thread_terminate_self( )
>
>Any body can help me, how to bind thread and terminate thread on
10.4 machine
These routines are not part of any KPI, and thus are not exported by
Mac OS X for general developer use. Can you explain what you're
using them for?
<
http://developer.apple.com/documentation/Darwin/Conceptual/KernelProgramming/index.html>
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/
>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden