~raof/mir/lots-of-unused-lambda-captures

« back to all changes in this revision

Viewing changes to src/include/common/mir/thread_safe_list.h

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2017-08-21 10:16:23 UTC
  • mfrom: (4231.1.3 mir2)
  • Revision ID: tarmac-20170821101623-by9rt9ei55tqqpaa
Reimplement BroadcastingSessionEventSink using a similar "observer" idiom to that we use elsewhere.

Approved by Chris Halse Rogers, mir-ci-bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 *    - copy-assignable
35
35
 *  - add():
36
36
 *    - copy-assignable
37
 
 *    - operator bool: returns whether this is a valid element
 
37
 *    - conversion to bool: indicates whether this is a valid element
38
38
 *  - remove(), remove_all():
39
39
 *    - copy-assignable
40
40
 *    - Element{}: default construction should create an invalid element
42
42
 *    - bool operator!=: inequality of elements
43
43
 *  - clear():
44
44
 *    - copy-assignable
45
 
 *    - Element{}: default construction should create an invalid element
 
45
 *    - Element{}: value initialization should create an invalid element
46
46
 */
47
47
 
48
48
template<class Element>
60
60
    {
61
61
        ListItem() {}
62
62
        RecursiveReadWriteMutex mutex;
63
 
        Element element;
 
63
        Element element{};
64
64
        std::atomic<ListItem*> next{nullptr};
65
65
 
66
66
        ~ListItem() { delete next.load(); }