Jump to content

"ownership failure (chMtxUnlock)" in gwinSetText()


Recommended Posts

Posted

I got error "ownership failure (chMtxUnlock)" while trying to call gwinSetText() from second thread (its used to display free space on USB). In trace I see that this is chDbgAssert in chMtxUnlock(), where ctp == my second thread, and ctp->p_mtxlist->m_owner pointed to flash rom area of CPU (with no name of thread).

I'm creating GUI from main(), not from any thread.

What I'm doing wrong? What should I do to get access to labels from any place?

Thanks!

Posted

Calling gwinSetText() invokes a redraw of the corresponding widget and therefore invokes calls from the GDISP module that access the display. The GDISP API is only multi-thread safe is GDISP_NEED_MULTITHREAD has been set to TRUE in your configuration file.

~ Tectu

Posted

Yes, stack size is an important issue with any gui window system.

For ugfx there are two stack sizes that are important...

The main thread (or any other drawing thread) stack.

The gtimer thread stack size.

If either is too small all sorts of strange things happen.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...