• James Sedgwick's avatar
    via with priority · c8250894
    James Sedgwick authored
    Summary:
    I wish I could just have an add(Func, priority) but the damned overloaded virtual warnings become a nightmare, so it's addWithPriority.
    I also switched priority to a uint8_t in the hopes of reducing Core size. Turns out std::atomic<uint8_t> is 8 bytes anyways :( I left it that way because come on you really shouldn't be using > 256 priorities.
    Biggest problem is the data race with the two atomics executor_ and priority_. Should we just use a microspinlock to co-protect them? Could probably save some size from the atomics that way.
    
    Test Plan: unit
    
    Reviewed By: hans@fb.com
    
    Subscribers: hannesr, fugalh, folly-diffs@, jsedgwick, yfeldblum, chalfant
    
    FB internal diff: D2039619
    
    Tasks: 6928162
    
    Signature: t1:2039619:1431551266:3b31ed2329301aaa9c32f0f41b6e61f3482d570e
    c8250894
Future.h 13.9 KB