Tervel  1.0.0
A collection of wait-free containers and algorithms.
descriptor_read_first_op.h
Go to the documentation of this file.
1 /*
2 The MIT License (MIT)
3 
4 Copyright (c) 2015 University of Central Florida's Computer Software Engineering
5 Scalable & Secure Systems (CSE - S3) Lab
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 THE SOFTWARE.
24 */
25 #ifndef DESCRIPTOR_READ_FIRST_OP_H_
26 #define DESCRIPTOR_READ_FIRST_OP_H_
27 
28 #include <tervel/util/info.h>
31 
32 namespace tervel {
33 namespace util {
34 
35 class Descriptor;
36 
37 namespace memory {
38 namespace rc {
39 
44 class ReadFirstOp : public util::OpRecord {
45  public:
46  explicit ReadFirstOp(std::atomic<void *> *address) {
47  address_ = address;
48  value_.store(nullptr);
49  }
50 
52 
57  void help_complete();
58 
59  void *load();
60 
61  private:
62  std::atomic<void *> *address_;
63  std::atomic<void *> value_;
64 }; // ReadFirstOp class
65 
66 } // namespace rc
67 } // namespace memory
68 } // namespace util
69 } // namespace tervel
70 
71 #endif // DESCRIPTOR_READ_FIRST_OP_H_
std::atomic< void * > * address_
Definition: descriptor_read_first_op.h:62
std::atomic< void * > value_
Definition: descriptor_read_first_op.h:63
TODO(steven):
Definition: mcas.h:36
~ReadFirstOp()
Definition: descriptor_read_first_op.h:51
void help_complete()
This function overrides the virtual function in the OpRecord class It is called by the progress assur...
This class is used to create Operation Records.
Definition: progress_assurance.h:52
ReadFirstOp(std::atomic< void * > *address)
Definition: descriptor_read_first_op.h:46
Class used for placement in the Op Table to complete an operation that failed to complete in a bounde...
Definition: descriptor_read_first_op.h:44