problem about thread assertion failed | developer.brewmp.com problem about thread assertion failed | developer.brewmp.com

Developer

problem about thread assertion failed

Forums:

i call function ITHREAD_Start to start a thread.
In a while loop i resume the thread.
But when debugging it shows the following states:
*AEEThread.c:192 - assertion failed (\release-builds\brewery\libdev\src\Aee\AEEThread.c:192): "me->bCurThread"

I want to know what it means and how to correct it.

I also encountered the same issue, were you able to resolve.

I also encountered the same issue, were you able to resolve.

How do you resume the thread ? Can you elaborate more ?
If you call IThread_suspend then the condition applies :
This function must only be called from within the IThread. Calling from outside the IThread has no effect.
This is when the exception arises. To resolve this, the suspend function call has to be from within the thread.

How do you resume the thread ? Can you elaborate more ?
If you call IThread_suspend then the condition applies :
This function must only be called from within the IThread. Calling from outside the IThread has no effect.
This is when the exception arises. To resolve this, the suspend function call has to be from within the thread.

ash_123 wrote:How do you resume the thread ? Can you elaborate more ?
If you call IThread_suspend then the condition applies :
This function must only be called from within the IThread. Calling from outside the IThread has no effect.
This is when the exception arises. To resolve this, the suspend function call has to be from within the thread.
Hi,
Ya i m calling IThread_suspend from within the thread itself.
Actually in the IThread_Start i m calling the same function where furthur i have used IThread_suspend on some condition, can this lead to a problem???

ash_123 wrote:How do you resume the thread ? Can you elaborate more ?
If you call IThread_suspend then the condition applies :
This function must only be called from within the IThread. Calling from outside the IThread has no effect.
This is when the exception arises. To resolve this, the suspend function call has to be from within the thread.
Hi,
Ya i m calling IThread_suspend from within the thread itself.
Actually in the IThread_Start i m calling the same function where furthur i have used IThread_suspend on some condition, can this lead to a problem???

then it should not show an error..
it depends on whether you are doing this in the ithread_start function call.. i.e. the function which actually starts executing the thread

then it should not show an error..
it depends on whether you are doing this in the ithread_start function call.. i.e. the function which actually starts executing the thread

Hi all .. i too got the same problem after calling ITHREAD_Suspend .. i called this with in the thread start function only .. im getting error in output window as
"*AEEThread.c:189 - assertion failed (\code312\brewery\libdev\src\Aee\AEEThread.c:189): "me->bCurThread"
"*AEEThread.c:159 - assertion failed (\code312\brewery\libdev\src\Aee\AEEThread.c:159): "!me->bExited"
wat should i do now ..
Thanks in advance,
Lokesh

Hi all .. i too got the same problem after calling ITHREAD_Suspend .. i called this with in the thread start function only .. im getting error in output window as
"*AEEThread.c:189 - assertion failed (\code312\brewery\libdev\src\Aee\AEEThread.c:189): "me->bCurThread"
"*AEEThread.c:159 - assertion failed (\code312\brewery\libdev\src\Aee\AEEThread.c:159): "!me->bExited"
wat should i do now ..
Thanks in advance,
Lokesh

Hi,
The error occured bcoz i guess u hav called IThread_suspend in the same function where IThread_Start is called, reason being first BREW's main thread finishes the current event loop and then goes to the function which is called by IThread_Start,
so currently your active thread is BREW's main thread and not the one which u hav instantiated. :rolleyes:

Hi,
The error occured bcoz i guess u hav called IThread_suspend in the same function where IThread_Start is called, reason being first BREW's main thread finishes the current event loop and then goes to the function which is called by IThread_Start,
so currently your active thread is BREW's main thread and not the one which u hav instantiated. :rolleyes:

Hi,
I am new Brew and trying to port a J2ME app to brew.
I have a problem similar to the "Producer-Consumer" problem.
I tried solving this using the IThread and ended getting a
error:
*AEEThread.c:189 - assertion failed (\sdk-release-builds\brewery\libdev\src\Aee\AEEThread.c:189): "me->bCurThread"
I have two threads:
1. Producer
2. Consumer
The consumer thread needs to wait till the producer thread produces a product.But putting a IThread_CondVarTimedWait inside the producer run method doesnt work and gives me the assertion failed error.
Please find below the chunk of code am using:
Producer:
Producer::Producer(Product* product)
{
this->product=product;
i=0;

Producer::~Producer()
{
}
void Producer::run()
{
while(1)
{
product->produce();
product->notify();
}

Consumer:
Consumer::Consumer(Product* product)
{
this->product=product;

Consumer::~Consumer()
{

void Consumer::run()
{
while(1)
{
product->wait();
product->consume();
}

Product:
Product::Product()
{
i=0;

Product::~Product()
{
}
void Product::produce()
{
DBGPRINTF("Produced: %d",i);
i++;

void Product::consume()
{
DBGPRINTF("Consumed: %d",i);

wait(long ms)
void wait(Thread* thread_,long long ms=INFINITE)
{
IThread_MutexGrab(thread_->getNativeThread(),&mutex);
if(ms!=INFINITE)
{
IThread_CondVarTimedWait(thread_->getNativeThread(),&conditionvar,&mutex,P_ISHELL,ms);
}
}
notify()
void notify()
{
AEECondVar_Signal(&conditionvar,P_ISHELL);
}
EVT_APP_START:
t1 = new Thread(new Producer(product));
t2 = new Thread(new Consumer(product));
t2->start();
t1->start();
I hope that there is a solution to such problems in Brew.
Thanks,

Hi,
I am new Brew and trying to port a J2ME app to brew.
I have a problem similar to the "Producer-Consumer" problem.
I tried solving this using the IThread and ended getting a
error:
*AEEThread.c:189 - assertion failed (\sdk-release-builds\brewery\libdev\src\Aee\AEEThread.c:189): "me->bCurThread"
I have two threads:
1. Producer
2. Consumer
The consumer thread needs to wait till the producer thread produces a product.But putting a IThread_CondVarTimedWait inside the producer run method doesnt work and gives me the assertion failed error.
Please find below the chunk of code am using:
Producer:
Producer::Producer(Product* product)
{
this->product=product;
i=0;

Producer::~Producer()
{
}
void Producer::run()
{
while(1)
{
product->produce();
product->notify();
}

Consumer:
Consumer::Consumer(Product* product)
{
this->product=product;

Consumer::~Consumer()
{

void Consumer::run()
{
while(1)
{
product->wait();
product->consume();
}

Product:
Product::Product()
{
i=0;

Product::~Product()
{
}
void Product::produce()
{
DBGPRINTF("Produced: %d",i);
i++;

void Product::consume()
{
DBGPRINTF("Consumed: %d",i);

wait(long ms)
void wait(Thread* thread_,long long ms=INFINITE)
{
IThread_MutexGrab(thread_->getNativeThread(),&mutex);
if(ms!=INFINITE)
{
IThread_CondVarTimedWait(thread_->getNativeThread(),&conditionvar,&mutex,P_ISHELL,ms);
}
}
notify()
void notify()
{
AEECondVar_Signal(&conditionvar,P_ISHELL);
}
EVT_APP_START:
t1 = new Thread(new Producer(product));
t2 = new Thread(new Consumer(product));
t2->start();
t1->start();
I hope that there is a solution to such problems in Brew.
Thanks,

Hi,
I have the same problem mentioned above?
How to synchronize between multi threads here using wait()/notify() methods?
Can someone please help? It is urgent and blocker also :(
Regards,
Aahna

Hi,
I have the same problem mentioned above?
How to synchronize between multi threads here using wait()/notify() methods?
Can someone please help? It is urgent and blocker also :(
Regards,
Aahna