[Groonga-commit] pgroonga/pgroonga at 3da33f0 [master] Add missing lock while get relation

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jan 28 16:03:01 JST 2016


Kouhei Sutou	2016-01-28 16:03:01 +0900 (Thu, 28 Jan 2016)

  New Revision: 3da33f0c363781d379d931ea4eb2e4b058e8b76e
  https://github.com/pgroonga/pgroonga/commit/3da33f0c363781d379d931ea4eb2e4b058e8b76e

  Message:
    Add missing lock while get relation

  Modified files:
    src/pgroonga.c

  Modified: src/pgroonga.c (+3 -0)
===================================================================
--- src/pgroonga.c    2016-01-28 16:02:52 +0900 (9c81eba)
+++ src/pgroonga.c    2016-01-28 16:03:01 +0900 (8bc218d)
@@ -3105,10 +3105,13 @@ PGrnRemoveUnusedTables(void)
 		relationID = strtol(name + strlen(min), &nameEnd, 10);
 		if (nameEnd[0] == '.')
 			continue;
+
+		LockRelationOid(relationId, AccessShareLock);
 		relation = RelationIdGetRelation(relationID);
 		if (RelationIsValid(relation))
 		{
 			RelationClose(relation);
+			UnlockRelationOid(relationId, AccessShareLock);
 			continue;
 		}
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index