5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_UTILITIES_WORKGROUP_HPP
26 #define SHARE_VM_UTILITIES_WORKGROUP_HPP
27
28 #include "runtime/thread.inline.hpp"
29 #include "utilities/taskqueue.hpp"
30
31 // Task class hierarchy:
32 // AbstractGangTask
33 // AbstractGangTaskWOopQueues
34 //
35 // Gang/Group class hierarchy:
36 // AbstractWorkGang
37 // WorkGang
38 // FlexibleWorkGang
39 // YieldingFlexibleWorkGang (defined in another file)
40 //
41 // Worker class hierarchy:
42 // GangWorker (subclass of WorkerThread)
43 // YieldingFlexibleGangWorker (defined in another file)
44
45 // Forward declarations of classes defined here
46
47 class WorkGang;
48 class GangWorker;
49 class YieldingFlexibleGangWorker;
511 static bool _stat_init;
512 int _index;
513
514 public:
515 FreeIdSet(int sz, Monitor* mon);
516 ~FreeIdSet();
517
518 static void set_safepoint(bool b);
519
520 // Attempt to claim the given id permanently. Returns "true" iff
521 // successful.
522 bool claim_perm_id(int i);
523
524 // Returns an unclaimed parallel id (waiting for one to be released if
525 // necessary). Returns "-1" if a GC wakes up a wait for an id.
526 int claim_par_id();
527
528 void release_par_id(int id);
529 };
530
531 #endif // SHARE_VM_UTILITIES_WORKGROUP_HPP
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_SHARED_WORKGROUP_HPP
26 #define SHARE_VM_GC_SHARED_WORKGROUP_HPP
27
28 #include "gc/shared/taskqueue.hpp"
29 #include "runtime/thread.inline.hpp"
30
31 // Task class hierarchy:
32 // AbstractGangTask
33 // AbstractGangTaskWOopQueues
34 //
35 // Gang/Group class hierarchy:
36 // AbstractWorkGang
37 // WorkGang
38 // FlexibleWorkGang
39 // YieldingFlexibleWorkGang (defined in another file)
40 //
41 // Worker class hierarchy:
42 // GangWorker (subclass of WorkerThread)
43 // YieldingFlexibleGangWorker (defined in another file)
44
45 // Forward declarations of classes defined here
46
47 class WorkGang;
48 class GangWorker;
49 class YieldingFlexibleGangWorker;
511 static bool _stat_init;
512 int _index;
513
514 public:
515 FreeIdSet(int sz, Monitor* mon);
516 ~FreeIdSet();
517
518 static void set_safepoint(bool b);
519
520 // Attempt to claim the given id permanently. Returns "true" iff
521 // successful.
522 bool claim_perm_id(int i);
523
524 // Returns an unclaimed parallel id (waiting for one to be released if
525 // necessary). Returns "-1" if a GC wakes up a wait for an id.
526 int claim_par_id();
527
528 void release_par_id(int id);
529 };
530
531 #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP
|