We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 761c364 commit cb0267dCopy full SHA for cb0267d
bigframes/core/guid.py
@@ -11,16 +11,19 @@
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
-
+import threading
15
import typing
16
17
+_GUID_LOCK = threading.Lock()
18
_GUID_COUNTER = 0
19
20
21
def generate_guid(prefix="col_"):
- global _GUID_COUNTER
22
- _GUID_COUNTER += 1
23
- return f"bfuid_{prefix}{_GUID_COUNTER}"
+ global _GUID_LOCK
+ with _GUID_LOCK:
24
+ global _GUID_COUNTER
25
+ _GUID_COUNTER += 1
26
+ return f"bfuid_{prefix}{_GUID_COUNTER}"
27
28
29
class SequentialUIDGenerator:
0 commit comments