From c99ea629878bf15cb9b7fdb18d68bd45851b490d Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Mon, 25 Feb 2019 13:33:12 +0100 Subject: [PATCH] Fix race condition --- mysql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql.go b/mysql.go index 40202e12..6d9baf7d 100644 --- a/mysql.go +++ b/mysql.go @@ -35,7 +35,7 @@ type DBWrapper struct { } func (dbw *DBWrapper) IsConnected() bool { - return *dbw.ConnectedAtomic != 0 + return atomic.LoadUint32(dbw.ConnectedAtomic) != 0 } func (dbw *DBWrapper) CompareAndSetConnected(connected bool) (swapped bool) {