Skip to content
  • Giorgos Korfiatis's avatar
    Make ForUpdateManager thread-safe · 6d8e24e8
    Giorgos Korfiatis authored
    The manager held a global flag `_for_update' on a single manager object,
    which could be read or set by multiple threads.
    
    select_for_update() is now provided by a subclass of QuerySet.
    It must be used as the last modifier of a query set,
    e.g. Project.objects.filter(state=1).select_for_update(),
    and cannot be combined with operators provided by other subclasses,
    such as values_list().
    
    Since get() returns an element rather than a query set,
    the manager also provides a specific function get_for_update().
    6d8e24e8