Track whether the clock has started. (#7810)

This commit is contained in:
Matt Einhorn 2022-02-24 13:35:47 -05:00 committed by GitHub
parent 1c83cdf2c7
commit 2effe2ed03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -95,6 +95,7 @@ cdef class CyClockBase(object):
cdef public object _lock_acquire
cdef public object _lock_release
cdef public int has_started
cdef public int has_ended
cdef public object _del_safe_lock
cdef public int _del_safe_done

View File

@ -260,6 +260,7 @@ cdef class CyClockBase(object):
self._del_safe_lock = RLock()
self._del_safe_done = False
self.has_ended = False
self.has_started = False
def start_clock(self):
"""Must be called to start the clock.
@ -268,7 +269,10 @@ cdef class CyClockBase(object):
"""
self._lock_acquire()
try:
pass
if self.has_started:
return
self.has_started = True
# for now don't raise an exception when restarting because kivy's
# graphical tests are not setup to handle clock isolation so they try
# to restart the clock