Changeset 16303


Ignore:
Timestamp:
06/06/12 18:08:10 (12 years ago)
Author:
nit
Message:

[titan] fix mutexe

Location:
titan/titan
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/channel.h

    r16286 r16303  
    5858{
    5959        debug(1000, "in");
    60         struct channel *node = channel;
    6160
    6261        m_lock(&status.channelmutex, 5);
     62  struct channel *node = channel;
     63 
    6364        while(node != NULL)
    6465        {
     
    279280{
    280281        //debug(1000, "in");
    281         struct channel *newnode = NULL, *prev = NULL, *node = channel;
     282        struct channel *newnode = NULL, *prev = NULL, *node = NULL;
    282283        char *name = NULL;
    283284        int ret = 0;
     
    328329
    329330        m_lock(&status.channelmutex, 5);
     331  node = channel;
    330332
    331333        modifychannelcache(newnode->serviceid, newnode->transponderid, newnode);
     
    444446        debug(1000, "in");
    445447        int ret = 1;
    446         struct channel *node = channel, *prev = channel;
    447448        struct provider* providernode = NULL;
    448449
    449450        m_lock(&status.channelmutex, 5);
     451  struct channel *node = channel, *prev = channel;
    450452
    451453        while(node != NULL)
     
    567569        debug(1000, "in");
    568570        FILE *fd = NULL;
    569         struct channel *node = channel;
     571        struct channel *node = NULL;
    570572        int ret = 0;
    571573
     
    578580
    579581        m_lock(&status.channelmutex, 5);
     582  node = channel;
     583 
    580584        while(node != NULL)
    581585        {
  • titan/titan/dmxdev.h

    r15914 r16303  
    3131        debug(1000, "in");
    3232        int fd = -1;
    33         struct dvbdev* node = dvbdev;
    3433
    3534        if(fenode == NULL) return NULL;
    3635               
    3736        m_lock(&status.dmxdevmutex, 9);
     37  struct dvbdev* node = dvbdev;
    3838       
    3939        while(node != NULL)
  • titan/titan/linkedchannel.h

    r11897 r16303  
    6464        if(status.aktservice->channel != NULL)
    6565        {
     66    m_lock(&status.linkedchannelmutex, 14);
    6667                if(status.aktservice->channel->linkedchannel == NULL)
    6768                {
     
    8384                }
    8485
    85                 m_lock(&status.linkedchannelmutex, 14);
    8686                if(node == NULL)
    8787                        node = status.aktservice->channel->linkedchannel;
  • titan/titan/mediadb.h

    r16293 r16303  
    200200struct mediadbfilter* addmediadbfilter(struct mediadb* mnode, int count, struct mediadbfilter* last)
    201201{
    202         struct mediadbfilter *newnode = NULL, *prev = NULL, *node = mediadbfilter;
     202  m_lock(&status.mediadbmutex, 17);
     203 
     204        struct mediadbfilter *newnode = NULL, *prev = NULL, *node = NULL;
    203205
    204206        if(mnode == NULL) return NULL;
     
    215217
    216218        m_lock(&status.mediadbmutex, 17);
     219  node = mediadbfilter;
    217220
    218221        if(last == NULL)
     
    250253struct mediadbcategory* addmediadbcategory(char* line, int type, int count, struct mediadbcategory* last, int flag)
    251254{
    252         struct mediadbcategory *newnode = NULL, *prev = NULL, *node = mediadbcategory;
     255        struct mediadbcategory *newnode = NULL, *prev = NULL, *node = NULL;
    253256        char* name = NULL;
    254257        int ret = 0;
     
    299302
    300303        if(flag == 0) m_lock(&status.mediadbmutex, 17);
     304  node = mediadbcategory;
    301305
    302306        if(last == NULL)
     
    408412{
    409413        //debug(1000, "in");
    410         struct mediadb *newnode = NULL, *prev = NULL, *node = mediadb, *nnode = NULL;
     414        struct mediadb *newnode = NULL, *prev = NULL, *node = NULL, *nnode = NULL;
    411415        int ret = 0, free1 = 0;
    412416
     
    542546
    543547        if(flag == 0) m_lock(&status.mediadbmutex, 17);
     548  node = mediadb;
    544549
    545550        if(last == NULL)
     
    804809        debug(1000, "in");
    805810        int ret = 1;
    806         struct mediadbfilter *node = mediadbfilter, *prev = mediadbfilter;
    807811
    808812        m_lock(&status.mediadbmutex, 17);
     813  struct mediadbfilter *node = mediadbfilter, *prev = mediadbfilter;
    809814
    810815        while(node != NULL)
     
    845850        debug(1000, "in");
    846851        int ret = 1;
    847         struct mediadbcategory *node = mediadbcategory, *prev = mediadbcategory;
    848852
    849853        m_lock(&status.mediadbmutex, 17);
     854  struct mediadbcategory *node = mediadbcategory, *prev = mediadbcategory;
    850855
    851856        while(node != NULL)
     
    889894        debug(1000, "in");
    890895        int ret = 1;
    891         struct mediadb *node = mediadb, *prev = mediadb;
    892896
    893897        m_lock(&status.mediadbmutex, 17);
     898  struct mediadb *node = mediadb, *prev = mediadb;
    894899
    895900        while(node != NULL)
     
    977982        debug(1000, "in");
    978983        FILE *fd = NULL;
    979         struct mediadbcategory *node = mediadbcategory;
     984        struct mediadbcategory *node = NULL;
    980985        int ret = 0;
    981986
     
    988993
    989994        m_lock(&status.mediadbmutex, 17);
     995  node = mediadbcategory;
    990996
    991997        while(node != NULL)
     
    10101016        debug(1000, "in");
    10111017        FILE *fd = NULL;
    1012         struct mediadb *node = mediadb;
     1018        struct mediadb *node = NULL;
    10131019        int ret = 0;
    10141020
     
    10211027
    10221028        m_lock(&status.mediadbmutex, 17);
     1029  node = mediadb;
    10231030
    10241031        while(node != NULL)
     
    14751482                {
    14761483                        struct imdb* imdb = NULL;
     1484                        struct tmdb* tmdb = NULL;
    14771485
    14781486                        //create imdb search name
     
    14971505                        }
    14981506#endif
     1507
    14991508#ifdef SIMULATE
    15001509                        tmdb = gettmdb(imdb->id, 1, 1, 0);
     
    15411550#endif
    15421551                        imdb = NULL;
     1552
    15431553#ifdef SIMULATE
    15441554                        freetmdb(tmdb);
  • titan/titan/player.h

    r16286 r16303  
    206206        }
    207207       
     208  //TODO: warum der sleep?
    208209        usleep(500000);
    209210        m_lock(&status.tsseekmutex, 15);
  • titan/titan/rectimer.h

    r16286 r16303  
    325325{
    326326        int ret = 0;
    327         struct rectimer* node = rectimer, *newnode = NULL;
     327        struct rectimer* node = NULL, *newnode = NULL;
    328328        struct channel* chnode = NULL;
    329329        time_t t = time(NULL), begin = 0, end = 0;
    330330
    331331        m_lock(&status.rectimermutex, 1);
     332  node = rectimer;
    332333       
    333334        while(node != NULL)
     
    487488{
    488489        debug(1000, "in");
    489         struct rectimer *node = rectimer, *prev = rectimer;
    490 
    491         if(flag == 0)
    492                 m_lock(&status.rectimermutex, 1);
     490
     491        if(flag == 0) m_lock(&status.rectimermutex, 1);
     492  struct rectimer *node = rectimer, *prev = rectimer;
    493493
    494494        while(node != NULL)
     
    595595        debug(1000, "in");
    596596        FILE *fd = NULL;
    597         struct rectimer *node = rectimer;
     597        struct rectimer *node = NULL;
    598598        int ret = 0;
    599599        char* type = NULL;
     
    603603
    604604        if(flag == 0) m_lock(&status.rectimermutex, 1);
     605  node = rectimer;
    605606
    606607        fd = fopen(filename, "w");
  • titan/titan/timerthread.h

    r14039 r16303  
    2424{
    2525        debug(1000, "in");
    26         struct stimerthread *newnode = NULL, *prev = NULL, *node = stimerthread;
     26        struct stimerthread *newnode = NULL, *prev = NULL, *node = NULL;
    2727
    2828        newnode = (struct stimerthread*)malloc(sizeof(struct stimerthread));   
     
    4343
    4444        m_lock(&status.timerthreadmutex, 6);
     45  node = stimerthread;
     46 
    4547        if(last == NULL)
    4648        {
Note: See TracChangeset for help on using the changeset viewer.