]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epg_mutex is no longer needed
authorAndreas Öman <andreas@lonelycoder.com>
Sun, 27 Apr 2008 13:44:59 +0000 (13:44 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sun, 27 Apr 2008 13:44:59 +0000 (13:44 +0000)
ajaxui/ajaxui_channels.c
autorec.c
dvb_tables.c
epg.c
epg.h
htsclient.c
rpc.c

index bec126ea57429860bc9054867fd28a972868c606..d41ce2c26d105327db78940cf461853184384956 100644 (file)
@@ -139,8 +139,6 @@ ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
     if(LIST_FIRST(&ch->ch_transports) == NULL)
       continue;
 
-    epg_lock();
-
     tcp_qprintf(tq, "<div style=\"float:left; width: 25%%\">");
 
     snprintf(dispname, sizeof(dispname), "%s", ch->ch_name);
@@ -170,7 +168,6 @@ ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
 
     ajax_box_end(tq, AJAX_BOX_SIDEBOX);
     tcp_qprintf(tq, "</div>");
-    epg_unlock();
   }
 
   http_output_html(hc, hr);
index 53205aaf819248b1ea8be2c7cdfaa0704fec7a92..3b87b790f9933f15aa641af628c93c781c53265c 100644 (file)
--- a/autorec.c
+++ b/autorec.c
@@ -100,8 +100,6 @@ autorec_check_new_ar(autorec_t *ar)
   event_t *e;
   th_channel_t *ch;
 
-  epg_lock();
-
   LIST_FOREACH(ch, &channels, ch_global_link) {
     e = ch->ch_epg_cur_event;
     if(e == NULL)
@@ -117,7 +115,6 @@ autorec_check_new_ar(autorec_t *ar)
     if(autorec_cmp(ar, e))
       autorec_tag(ar, e);
   }
-  epg_unlock();
 }
 
 
index 45d61b72ed979a56cb44182686df706f795e7899..ffa589899dcb191cc4bbd4757a8e4b09dd2817cc 100644 (file)
@@ -259,8 +259,6 @@ dvb_eit_callback(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len,
   if(ch == NULL)
     return;
 
-  epg_lock();
-
   while(len >= 12) {
     event_id                  = ptr[0] << 8 | ptr[1];
     start_time                = dvb_convert_date(&ptr[2]);
@@ -311,8 +309,6 @@ dvb_eit_callback(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len,
       
     }
   }
-  
-  epg_unlock();
 }
 
 
diff --git a/epg.c b/epg.c
index d3e6a10c6d4a15eb708ba106e7ac1186d9d79b6e..3f7d481b501846f38fb34f08606230c6c0cc818d 100644 (file)
--- a/epg.c
+++ b/epg.c
 
 #define EPG_HASH_ID_WIDTH 256
 
-static pthread_mutex_t epg_mutex = PTHREAD_MUTEX_INITIALIZER;
 struct event_list epg_hash[EPG_HASH_ID_WIDTH];
 static dtimer_t epg_channel_maintain_timer;
 
 epg_content_group_t *epg_content_groups[16];
 
-void
-epg_lock(void)
-{
-  pthread_mutex_lock(&epg_mutex);
-}
-
-void
-epg_unlock(void)
-{
-  pthread_mutex_unlock(&epg_mutex);
-}
-
-
 void
 epg_event_set_title(event_t *e, const char *title)
 {
@@ -429,8 +415,6 @@ epg_channel_maintain(void *aux, int64_t clk)
 
   now = dispatch_clock;
 
-  epg_lock();
-
   LIST_FOREACH(ch, &channels, ch_global_link) {
 
     /* Age out any old events */
@@ -458,9 +442,6 @@ epg_channel_maintain(void *aux, int64_t clk)
 
     epg_locate_current_event(ch, now);
   }
-
-  epg_unlock();
-
 }
 
 
@@ -475,9 +456,6 @@ epg_transfer_events(th_channel_t *ch, struct event_queue *src,
   event_t *e;
   int cnt = 0;
 
-  epg_lock();
-
-
   if(strcmp(icon ?: "", ch->ch_icon ?: "")) {
     free(ch->ch_icon);
     ch->ch_icon = icon ? strdup(icon) : NULL;
@@ -491,7 +469,6 @@ epg_transfer_events(th_channel_t *ch, struct event_queue *src,
                     e->e_content_type);
     cnt++;
   }
-  epg_unlock();
 }
 
 static const char *groupnames[16] = {
diff --git a/epg.h b/epg.h
index c271a1787bc8d472cc83d80ee85a00416c2b9091..5fb6138b6e54a3c69af8f6ff8f59acf67cc33c97 100644 (file)
--- a/epg.h
+++ b/epg.h
@@ -23,10 +23,6 @@ extern epg_content_group_t *epg_content_groups[16];
 
 void epg_init(void);
 
-void epg_lock(void);
-
-void epg_unlock(void);
-
 event_t *epg_event_find_by_time0(struct event_queue *q, time_t start);
 
 event_t *epg_event_find_by_time(th_channel_t *ch, time_t start);
index c47c497e7c951207c79091a5beae62b0ffc4364c..cb8b4c118ffc45b700292bb6494aac19572cdd14 100644 (file)
@@ -323,8 +323,6 @@ cr_event_info(client_t *c, char **argv, int argc)
   if(argc < 2)
     return 1;
 
-  epg_lock();
-
   if(!strcasecmp(argv[0], "tag")) 
     e = epg_event_find_by_tag(atoi(argv[1]));
   if(!strcasecmp(argv[0], "now")) 
@@ -335,7 +333,6 @@ cr_event_info(client_t *c, char **argv, int argc)
       e = epg_event_find_by_time(ch, atoi(argv[2]));
 
   if(e == NULL) {
-    epg_unlock();
     return 1;
   }
 
@@ -367,7 +364,6 @@ cr_event_info(client_t *c, char **argv, int argc)
          next,
          pvrr != NULL ? pvrr->pvrr_status : HTSTV_PVR_STATUS_NONE);
 
-  epg_unlock();
   return 0;
 }
 
@@ -383,17 +379,13 @@ cr_event_record(client_t *c, char **argv, int argc)
   if(argc < 1)
     return 1;
 
-  epg_lock();
-
   e = epg_event_find_by_tag(atoi(argv[0]));
   if(e == NULL) {
-    epg_unlock();
     return 1;
   }
 
   pvr_schedule_by_event(e, "htsclient");
 
-  epg_unlock();
   return 0;
 }
 
diff --git a/rpc.c b/rpc.c
index 6a30531ca46c506ab8e6bebe4c5b056af539d88b..f27455acd99ef39175b204321d89e7139d130d6c 100644 (file)
--- a/rpc.c
+++ b/rpc.c
@@ -153,8 +153,6 @@ rpc_event_info(rpc_session_t *ses, htsmsg_t *in, void *opaque)
   out = htsmsg_create();
   htsmsg_add_u32(out, "seq", ses->rs_seq);
 
-  epg_lock();
-
   if(htsmsg_get_u32(in, "tag", &u32) >= 0) {
     e = epg_event_find_by_tag(u32);
   } else if((s = htsmsg_get_str(in, "channel")) != NULL) {
@@ -204,8 +202,6 @@ rpc_event_info(rpc_session_t *ses, htsmsg_t *in, void *opaque)
       htsmsg_add_u32(out, "pvrstatus", pvrr->pvrr_status);
   }
 
-  epg_unlock();
-
   return out;
 }