global_event.hh (9983:2cce74fe359e) global_event.hh (10153:936a3a8006f6)
1/*
2 * Copyright (c) 2011-2013 Advanced Micro Devices, Inc.
3 * Copyright (c) 2013 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 77 unchanged lines hidden (view full) ---

86 }
87
88 ~BarrierEvent();
89
90 friend class BaseGlobalEvent;
91
92 bool globalBarrier()
93 {
1/*
2 * Copyright (c) 2011-2013 Advanced Micro Devices, Inc.
3 * Copyright (c) 2013 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 77 unchanged lines hidden (view full) ---

86 }
87
88 ~BarrierEvent();
89
90 friend class BaseGlobalEvent;
91
92 bool globalBarrier()
93 {
94 // This method will be called from the process() method in
95 // the local barrier events
96 // (GlobalSyncEvent::BarrierEvent). The local event
97 // queues are always locked when servicing events (calling
98 // the process() method), which means that it will be
99 // locked when entering this method. We need to unlock it
100 // while waiting on the barrier to prevent deadlocks if
101 // another thread wants to lock the event queue.
102 EventQueue::ScopedRelease release(curEventQueue());
94 return _globalEvent->barrier->wait();
95 }
96
97 public:
98 virtual BaseGlobalEvent *globalEvent() { return _globalEvent; }
99 };
100
101 //! The barrier that all threads wait on before performing the

--- 129 unchanged lines hidden ---
103 return _globalEvent->barrier->wait();
104 }
105
106 public:
107 virtual BaseGlobalEvent *globalEvent() { return _globalEvent; }
108 };
109
110 //! The barrier that all threads wait on before performing the

--- 129 unchanged lines hidden ---