示例#1
0
    //FUZZ: disable check_for_lack_ACE_OS
    void send (void const* msg, size_t size)
    {
    //FUZZ: enable check_for_lack_ACE_OS

      if (size > Protocol::MAX_PAYLOAD_SIZE) throw InvalidArg ();

      // Note the potential deadlock if I lock mutex_ and out_data_ in
      // reverse order.

      MessageQueueAutoLock l1 (out_data_);
      AutoLock l2 (mutex_);

      throw_if_failed ();

      out_data_.push (MessagePtr (new Send (msg, size)));

      l1.unlock (); // no need to keep it locked

      while (true)
      {
        throw_if_failed ();

        if (!in_send_data_.empty ())
        {
          MessagePtr m (in_send_data_.front ());
          in_send_data_.pop ();

          std::type_info const* exp = &typeid (*m);

          if (exp == typeid (ACE_TMCast::Aborted))
          {
            throw Group::Aborted ();
          }
          else if (exp == typeid (Commited))
          {
            return;
          }
          else
          {
            // cerr << "send: group-scheduler messaging protocol violation; "
            //     << "unexpected message " << typeid (*m).name ()
            //     << " " << typeid (Aborted).name () << endl;

            ACE_OS::abort ();
          }
        }

        // cerr << "send: waiting on condition" << endl;
        send_cond_.wait ();
        // cerr << "send: wokeup on condition" << endl;
      }
    }
示例#2
0
void ShaderObjectInfo::validateParameter(const GLenum parameter) const {
    static const ValidGLValues VALID_SHADER_OBJECT_PARAMETERS({
        ONUX_VALID_GL_VALUE(GL_SHADER_TYPE),
        ONUX_VALID_GL_VALUE(GL_DELETE_STATUS),
        ONUX_VALID_GL_VALUE(GL_COMPILE_STATUS),
        ONUX_VALID_GL_VALUE(GL_INFO_LOG_LENGTH),
        ONUX_VALID_GL_VALUE(GL_SHADER_SOURCE_LENGTH),
    });

    if (!VALID_SHADER_OBJECT_PARAMETERS.contains(parameter)) {
        throw InvalidArg(
            "parameter",
            "ShaderObjectInfo::getValue",
            VALID_SHADER_OBJECT_PARAMETERS.getNames()
        );
    }
}