You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
303 B
15 lines
303 B
2 years ago
|
from multiprocessing import Value
|
||
|
|
||
|
|
||
|
class SharedCount:
|
||
|
def __init__(self, epoch: int = 0):
|
||
|
self.shared_epoch = Value('i', epoch)
|
||
|
|
||
|
@property
|
||
|
def value(self):
|
||
|
return self.shared_epoch.value
|
||
|
|
||
|
@value.setter
|
||
|
def value(self, epoch):
|
||
|
self.shared_epoch.value = epoch
|