]> git.proxmox.com Git - mirror_corosync.git/commitdiff
Remove a double unlock in logsys.
authorAngus Salkeld <asalkeld@redhat.com>
Mon, 7 Sep 2009 08:33:23 +0000 (08:33 +0000)
committerAngus Salkeld <asalkeld@redhat.com>
Mon, 7 Sep 2009 08:33:23 +0000 (08:33 +0000)
In logsys there are a number of XYZ_unlocked() functions that are called
like this:

       pthread_mutex_lock (&logsys_config_mutex);

       XYZ_unlocked();

       pthread_mutex_unlock (&logsys_config_mutex);

The XYZ_unlocked() functions should not do any (un)locking.
But _logsys_config_subsys_get_unlocked() unlocks if it finds the subsys.
This means that there is 1 lock and 2 unlocks.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2404 fd59a12c-fef9-0310-b244-a6a79926bd2f

exec/logsys.c

index a54385f239ceaff8a7470d5165a80aae93199b7f..3b40786d3a9cc6e9382da14826d6e1561dd43200 100644 (file)
@@ -824,7 +824,6 @@ static int _logsys_config_subsys_get_unlocked (const char *subsys)
 
        for (i = 0; i <= LOGSYS_MAX_SUBSYS_COUNT; i++) {
                if (strcmp (logsys_loggers[i].subsys, subsys) == 0) {
-                       pthread_mutex_unlock (&logsys_config_mutex);
                        return i;
                }
        }