<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="WordSection1">
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<a name="_olk_replyheader"><span style=""> </span></a></p>
<span style=""></span>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<a name="_olk_quotedtext"><span style="">Hi everyone.</span></a></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">I have problems with <b><span style="color: red;">g_main_loop_run</span></b><span style="color: red;">
</span>executing it in another thread. I’m using a Digital Persona U are U 4500 device.</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">I have an init function that opens a device, when the device is opened, then
<b><span style="color: red;">g_main_loop_run</span></b> is execute in another thread.</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">When I close the device calling <b><span style="color: red;">fp_device_close_sync</span></b> the result is TRUE but I have the following error:</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(process:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">38166</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">): libfprint-image_device-DEBUG: </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">10</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">56</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">02.418</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">: Image device close completed</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(process:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">38166</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">): libfprint-device-DEBUG: </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">10</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">56</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">02.418</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">: Device reported close completion</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(process:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">38166</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">): libfprint-device-DEBUG: </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">10</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">56</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">02.418</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">: Completing action FPI_DEVICE_ACTION_CLOSE in idle!</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(process:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">38166</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">): GLib-CRITICAL **: </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">10</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">56</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">:</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">02.418</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">: g_source_unref: assertion </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(206, 145, 120);">'source != NULL'</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> failed</span></span></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">The documentation for <b><span style="color: red;">fp_device_close_sync</span></b><span style="color: red;"> </span>says that the return value is:
</span></span><span style=""><span class="Heading3Char" style="font-family: "Calibri Light", sans-serif; color: rgb(31, 55, 99);"><span style="font-size:12.0pt">FALSE</span></span></span><span style=""><span style=""> on error,
</span></span><span style=""><span class="Heading3Char" style="font-family: "Calibri Light", sans-serif; color: rgb(31, 55, 99);"><span style="font-size:12.0pt">TRUE</span></span></span><span style=""><span style=""> otherwise. So, if the function returns TRUE
why this error?</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">Another problem is that sometimes calling <b><span style="color: red;">fp_device_close_sync</span></b> freezes the app because
<b><span style="color: red;">fp_device_close_sync</span></b> never returns.</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">Here is my code:</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">typedef</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">struct</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">{</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> FpContext *ctx;</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> ///< Libfprint context.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> FpDevice *device;</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> ///< Libfprint device.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(78, 201, 176);">pthread_t</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(78, 201, 176);">event_t</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">;</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> ///< The glib event loop thread.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> GMainLoop *gmloop;</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> ///< Glib event manager loop.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">}</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(78, 201, 176);">tETR_FP_CONTEXT</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">;</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">typedef</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">struct</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">{</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> tKERNEL_FSM *</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">fsm</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">;</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> ///< Finite State Machine structure pointer.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> tETR_FP_CONTEXT </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">;</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> ///< Fingerprint context structure.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">}</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(78, 201, 176);">tAUTOMATON_DATA</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">;</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">static</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">void</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">*</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">etr_fp_execute_loop</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">void</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">*</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">data</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">)</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">{</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> tAUTOMATON_DATA *aut = (tAUTOMATON_DATA *) data;</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">gmloop</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> = </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_main_loop_new</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">NULL</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,FALSE);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_main_loop_run</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">gmloop</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">return</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">NULL</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">;</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">}</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">void</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">init__entry</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(78, 201, 176);">tAUTOMATON_DATA</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">*</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">)</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">{</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> FpDevice *device;</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> GPtrArray *devices;</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_autoptr</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(GError) gerror = </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">NULL</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">;</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> = </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">fp_context_new</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">();</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> devices = </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">fp_context_get_devices</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">if</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> (devices && </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">devices</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">len</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">)</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> {</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> device = </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_ptr_array_index</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(devices,</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">0</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">device</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> = device;</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> // Open device</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">if</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> (</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">fp_device_open_sync</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">device</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">clops</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,&gerror)) </span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> {</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> // Execute g_main_loop_run in another thread</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">if</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> (!</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">pthread_create</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(&</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">event_t</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">NULL</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,&etr_fp_execute_loop,aut)) {</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">pthread_detach</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">event_t</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">KernelInsertEvent</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">fsm</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut_id</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,AUT_EVT_OPENED,</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">NULL</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(181, 206, 168);">0</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> }</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">else</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">LogError</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(206, 145, 120);">"Unable to create glib event loop thread"</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> }</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">else</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">LogError</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(206, 145, 120);">"Unable to open device. %s"</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">gerror</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">message</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> }</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">else</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">LogError</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(206, 145, 120);">"Unable to find a compatible device"</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">}</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">static</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">void</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">etr_fp_dev_close</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(78, 201, 176);">tAUTOMATON_DATA</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">*</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">)</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">{</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_autoptr</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(GError) gerror = </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">NULL</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">;</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">if</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> (!</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">fp_device_close_sync</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">device</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">NULL</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,&gerror))</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"> <span style="color: rgb(106, 153, 85); background-color: rgb(30, 30, 30); display: inline !important;">// Sometimes calling this
function </span></span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(106, 153, 85);"><span style="color: rgb(106, 153, 85); background-color: rgb(30, 30, 30); display: inline !important;"> {
// <span style="color: rgb(106, 153, 85); background-color: rgb(30, 30, 30); display: inline !important;">freezes the app. Because never returns.</span> </span></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">LogError</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(206, 145, 120);">"Error closing device: %s"</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">,</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">gerror</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">message</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> }</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_clear_object</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(&</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_clear_object</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(&</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">clops</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span></p>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(197, 134, 192);">if</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> (</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">gmloop</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> != </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(86, 156, 214);">NULL</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">) {</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_main_loop_quit</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">gmloop</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> </span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(220, 220, 170);">g_main_loop_unref</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">(</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">aut</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">-></span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">ctx</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">.</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(156, 220, 254);">gmloop</span></span><span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">);</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);"> }</span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 14.25pt; background: rgb(30, 30, 30);">
<span style=""><span style="font-size: 10.5pt; font-family: Consolas; color: rgb(212, 212, 212);">}</span></span></p>
</div>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">If I create a new context with <b><span style="color: red;">g_main_context_new</span></b> and apply to
<b><span style="color: red;">g_main_loop_new</span></b><span style="color: red;">
</span>as follows:</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">new_context = g_main_context_new();</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">aut->ctx.gmloop = g_main_loop_new(new_context, false);</span></span><span style=""><span style="font-size:10.0pt"></span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">and use the follow functions in the thread function:</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">static void * etr_fp_execute_loop(void *data)</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">{</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> tAUTOMATON_DATA *aut = (tAUTOMATON_DATA *) data;</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> g_main_context_push_thread_default(new_context);</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> g_main_loop_run(aut->ctx.gmloop);</span></span><span style=""><span style="font-size:10.0pt"></span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> g_main_context_pop_thread_default(new_context);</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> return NULL;</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">}</span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">Nothing works. </span></span><span style=""><span style="font-size:10.0pt"></span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style="">Hope someone can help me. </span></span><span style=""><span class="MsoHyperlinkFollowed" style="color: rgb(149, 79, 114); text-decoration: underline;"><span lang="EN" style="">Thank you all.</span></span></span><span style=""><span style=""></span></span></p>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style=""><span style=""> </span></span></p>
</div>
</body>
</html>