cyberdelia / atomic

An atomic class that guarantees atomic updates to its contained value.
https://atomic.readthedocs.org
MIT License
24 stars 5 forks source link

The C extension blocks on OSX 10.8.2 with xcode 4.6 #3

Closed gilles closed 11 years ago

gilles commented 11 years ago

Hi,

It seems the library blocks on OSX 10.8.2 with xcode 4.6

Here's the test script

import logging
from time import sleep
from metrology import Metrology

while True:
    timer = Metrology.timer('test')
    with timer:
        print 'sleep'
        sleep(1)
$ python test.py 
sleep
^CTraceback (most recent call last):
  File "test.py", line 15, in <module>
    sleep(1)
  File "/Library/Python/2.7/site-packages/metrology/instruments/timer.py", line 40, in __exit__
    self.update(duration)
  File "/Library/Python/2.7/site-packages/metrology/instruments/timer.py", line 27, in update
    self.meter.mark()
  File "/Library/Python/2.7/site-packages/metrology/instruments/meter.py", line 13, in wrapper
    return method(self, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/metrology/instruments/meter.py", line 63, in mark
    self.counter.update(lambda v: v + value)
  File "/Library/Python/2.7/site-packages/atomic/__init__.py", line 110, in update
    old_value = self.ref.get()
KeyboardInterrupt

I'll make some more tests to see if the native works

Thanks

cyberdelia commented 11 years ago

Thanks! Unfortunately, I will not be able to look into it until Monday.

cyberdelia commented 11 years ago

Closed in #4.