comparison hotspot/src/share/vm/gc/shared/workgroup.hpp @ 35465:34ab60aee787

8145037: Clean up FreeIdSet usage Summary: Avoid wasting space for the unused sets Reviewed-by: tschatzl
author aharlap
date Fri, 08 Jan 2016 15:41:44 -0500
parents d00805788fdd
children 8d947f31586e
comparison
equal deleted inserted replaced
10:04063a1b7322 11:b9c9473a22c7
376 // is the last thread to complete so that the thread can perform 376 // is the last thread to complete so that the thread can perform
377 // cleanup if necessary. 377 // cleanup if necessary.
378 bool all_tasks_completed(); 378 bool all_tasks_completed();
379 }; 379 };
380 380
381 // Represents a set of free small integer ids.
382 class FreeIdSet : public CHeapObj<mtGC> {
383 enum {
384 end_of_list = UINT_MAX,
385 claimed = UINT_MAX - 1
386 };
387
388 uint _size;
389 Monitor* _mon;
390
391 uint* _ids;
392 uint _hd;
393 uint _waiters;
394 uint _claimed;
395
396 public:
397 FreeIdSet(uint size, Monitor* mon);
398 ~FreeIdSet();
399
400 // Returns an unclaimed parallel id (waiting for one to be released if
401 // necessary).
402 uint claim_par_id();
403
404 void release_par_id(uint id);
405 };
406
407 #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP 381 #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP