From 6f87145f4723914c432253289dcbf5dc2d190d1f Mon Sep 17 00:00:00 2001
From: "Stephen R. van den Berg" <srb@cuci.nl>
Date: Thu, 25 Feb 2016 21:32:43 +0100
Subject: [PATCH] Revert "pgsql: Kludge around clone race in Pike core."

This reverts commit f339d7f8c91c995295fd74d52d95a6518b3a61fa.

The kludge should not be needed anymore due to a checked in fix
in the Pike compiler.
---
 lib/modules/Sql.pmod/pgsql.pike | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/lib/modules/Sql.pmod/pgsql.pike b/lib/modules/Sql.pmod/pgsql.pike
index 86bef9aade..b4b4d1697c 100644
--- a/lib/modules/Sql.pmod/pgsql.pike
+++ b/lib/modules/Sql.pmod/pgsql.pike
@@ -217,15 +217,7 @@ protected void create(void|string host, void|string database,
 
   if(!_port)
     _port = PGSQL_DEFAULT_PORT;
-
-  // FIXME Looks like a bug in the cloning of an object
-  // If we do not loop here, and this function is called in two threads
-  // simultaneously, *and* the .pgsql_util class has not been instantiated
-  // yet, then Pike can throw an "Attempting to clone an unfinished program"
-  // error.
-
-  while(catch(.pgsql_util.register_backend()))	// Placate race in cloning
-    sleep(0);					// Yield
+  .pgsql_util.register_backend();
   _shortmux=Thread.Mutex();
   reconnect();
 }
-- 
GitLab