⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 async.h

📁 c-smile 一个语法类似与JS 又有点像C++的 编译器
💻 H
字号:
//-< ASYNC.H >-------------------------------------------------------*--------*
// SAL                       Version 1.0         (c) 1997  GARRET    *     ?  *
// (System Abstraction Layer)                                        *   /\|  *
//                                                                   *  /  \  *
//                          Created:      7-Jan-97    K.A. Knizhnik  * / [] \ *
//                          Last update: 21-Nov-98    K.A. Knizhnik  * GARRET *
//-------------------------------------------------------------------*--------*
// Asyncronous event manager for cooperative multitasking in Unix 
//-------------------------------------------------------------------*--------*

#ifndef __ASYNC_H__
#define __ASYNC_H__

#if defined(__FreeBSD__)
#include <sys/types.h>
#endif

#include "task.h"
#include "unisock.h"
#include "support.h"

namespace sal
{

class async_event_manager { 
  private:
    static unsigned n_desc;
    static fd_set input_desc; 
    static fd_set output_desc; 
    
    static timeout_t select_timeout; 

    static dnm_array<unix_socket*> sockets; // attached sockets
    static l2elem active_timers; 

  public: 
    static void add_timer(ctimer* tmr);

    static void attach_input_channel(unix_socket* s);
    static void detach_input_channel(unix_socket* s);
    static void attach_output_channel(unix_socket* s);
    static void detach_output_channel(unix_socket* s);

    static void select(boolean wait);
}; 

};
#endif





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -