SpinLock does not compile for non-x86

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.0.3
    • Component/s: Concurrency
    • None
    • Environment:
      Target: arm-linux-gnueabi
      gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
    • Storage Execution
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Recent (unreleased) changes to add PAUSE instructions to spinlocks break compilation on non-x86 systems:

      g++ -o build/linux2/usev8/mongo/util/concurrency/spin_lock.o -c -Wnon-virtual-dtor -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -fno-builtin-memcmp -O3 -D_SCONS -DMONGO_EXPOSE_MACROS -D_FILE_OFFSET_BITS=64 -Ibuild/linux2/usev8 -Isrc -Ibuild/linux2/usev8/mongo -Isrc/mongo -Ibuild/linux2/usev8/third_party/pcre-7.4 -Isrc/third_party/pcre-7.4 -I/root/v8/include src/mongo/util/concurrency/spin_lock.cpp

      {standard input}: Assembler messages:{standard input}

      :124: Error: bad instruction `pause'

      The attached patch makes the use of PAUSE conditional on x86, and reverts to the previous code on non-x86.

            Assignee:
            [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            Trevor Robinson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: