> > main function program entry point -> main.cpp
>
> This is inside the function "int main(int argc, char **argv)" ? If so,
> then it is the "main" thread.
>
Yep. It is inside "int main(int argc, char **argv)". So I should assume my fltk
thread as main thread.
-----------------------------------------------------------------------
>
> > This is from cnc_gui.fl
> > Here it calls mngr thread
> >
> > // START COMMAND MANAGER THREAD:
> > memset(savedPosCoords, 0, sizeof(geom_data) *
> > axesNum2NameConformity::axesQuantity());
> > if ((msg_num = commandManager.run()) != MSG_NO_ERROR)
> > {
> > printf("\n *** %s ***\n", msg.getString(msg_num));
> > return;
> > }
> > else printf("\n COMMAND MANAGER STARTED\n");
> > last_coords_focus = 0;
> > offscreen_buf = 0;
> > pict_num = 0;
>
> No idea what this is. This isn't fltk code...
>
I've copypasted this part of code frome the fluid.From a green bar. I think it
something like function that should be executed at startup of thread. Is it
correct?
------------------------------------------------------------------------
>
> > // SET TIME VALUE REMAINING TO THE PROCESS END
> > Fl::lock();
> > char str[32];
> > unsigned long hours = (unsigned long) (RemainedTime / 3600.0);
> > unsigned long minutes = (unsigned long) ((RemainedTime -
> > ((double) hours) * 3600.0) / 60.0);
> > unsigned long seconds = (unsigned long) (RemainedTime -
> > ((double) hours) * 3600.0 - ((double) minutes) * 60.0);
> > sprintf(str, "%lu:%02lu:%02lu", hours, minutes, seconds);
> > time2end->value(str);
> > Fl::unlock();
> > Fl::flush();
>
> If this code is in a subsidiary thread, it must not call Fl::flush(). It
> should call Fl::awake() instead.
>
> If this code is in the main thread, it must not call lock/unlock.
>
> Either way, there is something wrong with that code that you must fix.
>
>
This is method of cnc_gui class. I've taken it from file "cnc_gui.fl"
It is called from cnc_mngr thread.
In cnc_mngr thread I call
cncGUI->setRemainingTime(10);
where cncGUI is the pointer to cnc_gui class.
So I assume that my code should be:
Fl::lock();
char str[32];
//do smth
time2end->value(str);
Fl::unlock();
Fl::awake();
if this code is in a subsidiary thread?
Thanks for the help. I've launched new version of the project. I've changed
Fl::flush() to Fl::redraw(). It will take some time to throw an error :). I
will try to use awake() and will post result later.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk