williams-queue: fixup header
authorBrian Norris <banorris@uci.edu>
Thu, 11 Oct 2012 23:40:05 +0000 (16:40 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 11 Oct 2012 23:40:05 +0000 (16:40 -0700)
commit52533e63ca15fb03eebc3fa838d274f1943366dc
tree7d76687e2326691b78063904abdce20c4e9a880c
parentadc372d8af13fdc07eba357f0c6de4319dbfce10
williams-queue: fixup header

Move the constructor lower, so that member definitions appear earlier
than it in the class definition.

Also, don't assign to members of the atomic structure directly; use a
temporary struct then assign the whole struct.

Still won't compile. Seeing linker errors, probably due to the fact that
this code uses a nonstandrad atomic template:
    std::atomic<counted_node_ptr>

Where counted_node_ptr is a struct with int and pointer members. Thus,
it has size of at least 96 bytes (32+64) and so probably isn't really
supported by atomics... I'm not sure where the author came up with this.

    $ g++ williams-queue.cc --std=c++0x
    /tmp/ccPQgiJC.o: In function `lock_free_queue<int>::lock_free_queue()': williams-queue.cc:(.text._ZN15lock_free_queueIiEC2Ev[_ZN15lock_free_queueIiEC5Ev]+0x92): undefined reference to `std::atomic<lock_free_queue<int>::counted_node_ptr>::load(std::memory_order) const'
    ...
    collect2: ld returned 1 exit status
williams-queue/williams-queue.h