Yes, you're right. I'm holding a simple lock within the wrapper for kernel_thread. Thanks for your help Jim and Brian. Regards, Herry
-----Original Message-----
From: Jim Magee [mailto:jmagee@apple.com]
Sent: Saturday, June 21, 2003 07:57
To: Herry Wiputra
Cc: darwin-kernel@lists.apple.com
Subject: Re: panic in thread_invoke
On Friday, June 20, 2003, at 12:04 AM, Herry Wiputra wrote:
I am having a problem with my kext keep panicing in
thread_invoke().
The exact error message is
panic: thread_invoke: preemption_level 1
You are either sleeping with preemption disabled explicitly, or
implicitly (by holding a real simple lock when you sleep).
In my code, I have a function which already hold a network funnel,
then enter this while loop in which it will sleep until an event
happen and spawn a new thread to handle some computation.
The new thread will also try to grab the network_funnel and will
release it when it returns.
My kext kept panicing on the second loop, after it spawns
a new thread
and sleep again waiting for an event to happen.
Does anyone ever comes across this issue before??
I'd have to see the exact code to provide any more feedback
than above.
But look for a simple lock that you forget to unlock
before sleeping.
--Jim
_______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.