#ifndef __X10_LANG_RUNTIME__POOL_H
#define __X10_LANG_RUNTIME__POOL_H

#include <x10rt.h>


#define X10_LANG_OBJECT_H_NODEPS
#include <x10/lang/Object.h>
#undef X10_LANG_OBJECT_H_NODEPS
#define X10_LANG_BOOLEAN_H_NODEPS
#include <x10/lang/Boolean.h>
#undef X10_LANG_BOOLEAN_H_NODEPS
#define X10_LANG_INT_H_NODEPS
#include <x10/lang/Int.h>
#undef X10_LANG_INT_H_NODEPS
namespace x10 { namespace util { namespace concurrent { 
class SimpleLatch;
} } } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace util { namespace concurrent { 
class Lock;
} } } 
namespace x10 { namespace lang { 
class Runtime__Semaphore;
} } 
namespace x10 { namespace lang { 
class Deque;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace lang { 
class Runtime__Worker;
} } 
namespace x10 { namespace lang { 
class Runtime;
} } 
namespace x10 { namespace lang { 
class Thread;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(Z1), class TPMGL(Z2), class TPMGL(U)> class Fun_0_2;
} } 
namespace x10 { namespace lang { 
class Any;
} } 
namespace x10 { namespace lang { 
class String;
} } 
namespace x10 { namespace lang { 
class System;
} } 
namespace x10 { namespace util { 
class Random;
} } 
namespace x10 { namespace lang { 
class Activity;
} } 
namespace x10 { namespace compiler { 
class Pinned;
} } 
namespace x10 { namespace lang { 

class Runtime__Pool : public x10::lang::Object   {
    public:
    RTT_H_DECLS_CLASS
    
    x10aux::ref<x10::util::concurrent::SimpleLatch> FMGL(latch);
    
    x10_boolean FMGL(wsEnd);
    
    x10_int FMGL(size);
    
    x10_int FMGL(spares);
    
    x10_int FMGL(dead);
    
    x10aux::ref<x10::util::concurrent::Lock> FMGL(lock);
    
    x10aux::ref<x10::lang::Runtime__Semaphore> FMGL(semaphore);
    
    x10aux::ref<x10::lang::Deque> FMGL(wsBlockedContinuations);
    
    x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::Runtime__Worker> > >
      FMGL(workers);
    
    virtual void __apply(x10_int n);
    virtual void increase();
    virtual void decrease(x10_int n);
    virtual void release();
    virtual x10aux::ref<x10::lang::Activity> scan(x10aux::ref<x10::util::Random> random,
                                                  x10aux::ref<x10::lang::Runtime__Worker> worker);
    virtual x10_int size();
    virtual x10aux::ref<x10::lang::Runtime__Pool> x10__lang__Runtime__Pool____x10__lang__Runtime__Pool__this(
      );
    void _constructor();
    
    static x10aux::ref<x10::lang::Runtime__Pool> _make();
    
    void __fieldInitializers44657();
    
    // Serialization
    public: static const x10aux::serialization_id_t _serialization_id;
    
    public: virtual x10aux::serialization_id_t _get_serialization_id() {
         return _serialization_id;
    }
    
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: static x10aux::ref<x10::lang::Reference> _deserializer(x10aux::deserialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};

} } 
#endif // X10_LANG_RUNTIME__POOL_H

namespace x10 { namespace lang { 
class Runtime__Pool;
} } 

#ifndef X10_LANG_RUNTIME__POOL_H_NODEPS
#define X10_LANG_RUNTIME__POOL_H_NODEPS
#ifndef X10_LANG_RUNTIME__POOL_H_GENERICS
#define X10_LANG_RUNTIME__POOL_H_GENERICS
#endif // X10_LANG_RUNTIME__POOL_H_GENERICS
#endif // __X10_LANG_RUNTIME__POOL_H_NODEPS
