[svn r364] Fixed a mutual exclusion bug on the Monitor Handler GIOChannel read callback.
1.1 --- a/gmyth/src/gmyth_livetv.c Wed Feb 14 21:35:23 2007 +0000
1.2 +++ b/gmyth/src/gmyth_livetv.c Wed Feb 14 22:24:39 2007 +0000
1.3 @@ -386,11 +386,8 @@
1.4
1.5 while (wait_to_transfer++ < GMYTHTV_TRANSFER_MAX_WAITS &&
1.6 (gmyth_recorder_is_recording (livetv->recorder) == FALSE))
1.7 - g_usleep (500);
1.8 + g_usleep (50);
1.9
1.10 - /* IS_RECORDING again, just like the MythTV backend does... */
1.11 - gmyth_recorder_is_recording (livetv->recorder);
1.12 -
1.13 if ( channel != NULL )
1.14 {
1.15 /* Pauses remote encoder. */
1.16 @@ -411,7 +408,7 @@
1.17
1.18 } /* if - changes the channel number */
1.19
1.20 - sleep (8); /* FIXME: this is evil (tpm) */
1.21 + sleep (4); /* FIXME: this is evil (tpm) */
1.22 }
1.23
1.24 /* DEBUG message */
2.1 --- a/gmyth/src/gmyth_monitor_handler.c Wed Feb 14 21:35:23 2007 +0000
2.2 +++ b/gmyth/src/gmyth_monitor_handler.c Wed Feb 14 22:24:39 2007 +0000
2.3 @@ -418,6 +418,8 @@
2.4 gsize len = 0;
2.5
2.6 static guint count = 0;
2.7 +
2.8 + myth_control_acquire_context ( monitor, TRUE );
2.9
2.10 if ( ( io_cond & G_IO_HUP ) != 0 )
2.11 {
2.12 @@ -430,10 +432,6 @@
2.13
2.14 GMythStringList *strlist = NULL;
2.15
2.16 - //GMythMonitorHandler *monitor = (GMythMonitorHandler*)data;
2.17 -
2.18 - myth_control_acquire_context (monitor, TRUE);
2.19 -
2.20 if ( NULL == io_channel ) {
2.21 g_debug ("Monitor socket is NULL!\n");
2.22 *ret = FALSE;
2.23 @@ -500,8 +498,6 @@
2.24
2.25 } /* main GThread while */
2.26
2.27 - myth_control_release_context (monitor);
2.28 -
2.29 if ( io_status == G_IO_STATUS_ERROR ) {
2.30 //gmyth_debug ("[%s] Error reading: %s\n", __FUNCTION__, error != NULL ? error->message : "" );
2.31 gmyth_debug ("Error reading MONITOR event socket.\n");
2.32 @@ -510,6 +506,7 @@
2.33 }
2.34
2.35 clean_up:
2.36 + myth_control_release_context (monitor);
2.37
2.38 return *ret;
2.39