本文整理匯總了C++中DENTER函數的典型用法代碼示例。如果您正苦於以下問題:C++ DENTER函數的具體用法?C++ DENTER怎麽用?C++ DENTER使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DENTER函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: sge_env_state_setup
static bool sge_env_state_setup(sge_env_state_class_t *thiz, const char *sge_root, const char *sge_cell, u_long32 sge_qmaster_port, u_long32 sge_execd_port, bool from_services, bool qmaster_internal, sge_error_class_t *eh)
{
DENTER(TOP_LAYER, "sge_env_state_setup");
thiz->set_sge_qmaster_port(thiz, sge_qmaster_port);
thiz->set_sge_execd_port(thiz, sge_execd_port);
thiz->set_sge_root(thiz, sge_root);
thiz->set_sge_cell(thiz, sge_cell);
set_from_services(thiz, from_services);
set_qmaster_internal(thiz, qmaster_internal);
/*thiz->dprintf(thiz);*/
DEXIT;
return true;
}
示例2: sge_thread_wait_for_signal
/****** uti/thread_ctrl/sge_thread_wait_for_signal() ***************************
* NAME
* sge_thread_wait_for_signal() -- block current thread till shutdown
*
* SYNOPSIS
* void sge_thread_wait_for_signal(void)
*
* FUNCTION
* A call of this function will block the executing thread until the
* shutdown of the process is triggered via sge_thread_notify_all_waiting()
*
* INPUTS
* void - NONE
*
* RESULT
* void - NONE
*
* NOTES
* MT-NOTE: sge_thread_wait_for_signal() is not MT safe
*
* SEE ALSO
* uti/thread_ctrl/sge_thread_notify_all_waiting()
*******************************************************************************/
void
sge_thread_wait_for_signal(void)
{
DENTER(THREAD_LAYER, "sge_thread_wait_for_signal");
sge_mutex_lock(THREAD_CONTROL_MUTEX, SGE_FUNC, __LINE__, &Thread_Control.mutex);
while (Thread_Control.shutdown_started == false) {
pthread_cond_wait(&Thread_Control.cond_var, &Thread_Control.mutex);
}
sge_mutex_unlock(THREAD_CONTROL_MUTEX, SGE_FUNC, __LINE__, &Thread_Control.mutex);
DEXIT;
return;
}
示例3: DENTER
/****** test_sge_lock_simple/thread_function() *********************************
* NAME
* thread_function() -- Thread function to execute
*
* SYNOPSIS
* static void* thread_function(void *anArg)
*
* FUNCTION
* Lock the global lock in read mode and sleep. Unlock the global lock.
*
* INPUTS
* void *anArg - thread function arguments
*
* RESULT
* static void* - none
*
* SEE ALSO
* test_sge_lock_simple/get_thrd_func()
*******************************************************************************/
static void *thread_function(void *anArg)
{
DENTER(TOP_LAYER, "thread_function");
SGE_LOCK(LOCK_GLOBAL, LOCK_READ);
#if 1
DPRINTF(("Thread %u sleeping at %d\n", sge_locker_id(), sge_get_gmt()));
#endif
sleep(5);
SGE_UNLOCK(LOCK_GLOBAL, LOCK_READ);
DEXIT;
return (void *)NULL;
} /* thread_function */
示例4: sge_signaler_initialize
void
sge_signaler_initialize(sge_gdi_ctx_class_t *ctx)
{
cl_thread_settings_t* dummy_thread_p = NULL;
dstring thread_name = DSTRING_INIT;
DENTER(TOP_LAYER, "sge_signaler_initialize");
sge_dstring_sprintf(&thread_name, "%s%03d", threadnames[SIGNALER_THREAD], 0);
cl_thread_list_setup(&(Main_Control.signal_thread_pool), "signal thread pool");
cl_thread_list_create_thread(Main_Control.signal_thread_pool, &dummy_thread_p,
cl_com_get_log_list(), sge_dstring_get_string(&thread_name), 0,
sge_signaler_main, NULL, NULL, CL_TT_SIGNALER);
sge_dstring_free(&thread_name);
DRETURN_VOID;
}
示例5: var_list_set_string
/****** sgeobj/var/var_list_set_string() **************************************
* NAME
* var_list_set_string -- add/change an variable
*
* SYNOPSIS
* void var_list_set_string(lList **varl,
* const char *name,
* const char *value);
*
* FUNCTION
* If the variable <name> does not already exist in <varl>,
* it is created and initialized with <value>.
* Otherwise, its value is overwritten with <value>
*
* INPUTS
* lList **varl - VA_Type list
* const char *name - the name of the variable
* const char *value - the (new) value of the variable
*
* SEE ALSO
* sgeobj/var/var_list_set_int()
* sgeobj/var/var_list_set_sge_u32()
* sgeobj/var/var_list_set_sharedlib_path()
******************************************************************************/
void var_list_set_string(lList **varl, const char *name, const char *value)
{
lListElem *elem;
DENTER(TOP_LAYER, "var_list_set_string");
if (varl == NULL || name == NULL || value == NULL) {
DEXIT;
return;
}
elem = lGetElemStr(*varl, VA_variable, name);
if (elem == NULL) {
elem = lAddElemStr(varl, VA_variable, name, VA_Type);
}
lSetString(elem, VA_value, value);
DEXIT;
}
示例6: suser_decrease_job_counter
/****** sgeobj/suser/suser_decrease_job_counter() *****************************
* NAME
* suser_decrease_job_counter() -- decrease the users job counter
*
* SYNOPSIS
* void suser_decrease_job_counter(lListElem *suser)
*
* FUNCTION
* The job counter within "suser" will be decreased by one
*
* INPUTS
* lListElem *suser - SU_Type list
*
* RESULT
* void - NONE
*
* SEE ALSO
* sgeobj/suser/SU_Type
* sgeobj/suser/Master_SUser_List
******************************************************************************/
void suser_decrease_job_counter(lListElem *suser)
{
DENTER(TOP_LAYER, "suser_decrease_job_counter");
if (suser != NULL) {
u_long32 jobs = lGetUlong(suser, SU_jobs);
if (jobs == 0) {
ERROR((SGE_EVENT, MSG_SUSERCNTISALREADYZERO_S,
lGetString(suser, SU_name)));
} else {
lAddUlong(suser, SU_jobs, -1);
}
}
DEXIT;
}
示例7: sge_send_all_reports
/*-------------------------------------------------------------------------*/
int sge_send_all_reports(sge_gdi_ctx_class_t *ctx, u_long32 now, int which,
report_source *report_sources)
{
int ret = 0;
unsigned long connect_time = 0;
DENTER(TOP_LAYER, "sge_send_all_reports");
/*
* Send reports only if there is not a communication error.
* Don't reset stored communication errors.
*/
cl_commlib_get_connect_time(ctx->get_com_handle(ctx),
(char *)ctx->get_master(ctx, true), (char*)prognames[QMASTER], 1,
&connect_time);
if (get_last_qmaster_register_time() >= connect_time && connect_time != 0) {
if (sge_get_com_error_flag(EXECD, SGE_COM_WAS_COMMUNICATION_ERROR, false) == false) {
const char *master_host = NULL;
lList *report_list = NULL;
int i = 0;
master_host = ctx->get_master(ctx, false);
DPRINTF(("SENDING LOAD AND REPORTS\n"));
report_list = lCreateList("report list", REP_Type);
for (i = 0; report_sources[i].type; i++) {
if (!which || which == report_sources[i].type) {
DPRINTF(("%s\n", report_types[report_sources[i].type - 1]));
report_sources[i].func(ctx, report_list, now, &(report_sources[i].next_send));
}
}
/* send load report asynchron to qmaster */
if (lGetNumberOfElem(report_list) > 0) {
/* wrap around */
if (++sge_execd_report_seqno == 10000) {
sge_execd_report_seqno = 0;
}
report_list_send(ctx, report_list, master_host, prognames[QMASTER], 1, 0);
}
lFreeList(&report_list);
}
} else {
ret = 1;
}
DRETURN(ret);
}
示例8: fGetHost
static int fGetHost(FILE *fp, lHost *tp)
{
int i;
char line[READ_LINE_LENGHT + 1];
char sp[READ_LINE_LENGHT + 1];
char *s;
DENTER(CULL_LAYER, "fGetHost");
if (!fp) {
LERROR(LEFILENULL);
DEXIT;
return -1;
}
if (fGetLine(fp, line, READ_LINE_LENGHT)) {
LERROR(LEFGETLINE);
DEXIT;
return -1;
}
s = line;
while (isspace((int) *s))
s++;
if (*s++ != '"') {
LERROR(LESYNTAX);
DEXIT;
return -1;
}
for (i = 0; s[i] != '\0' && s[i] != '"'; i++)
sp[i] = s[i];
if (s[i] != '"') {
LERROR(LESYNTAX);
DEXIT;
return -1;
}
sp[i] = '\0';
if (!(*tp = strdup(sp))) {
LERROR(LESTRDUP);
DEXIT;
return -1;
}
DEXIT;
return 0;
}
示例9: sge_scheduler_terminate
/****** qmaster/threads/sge_scheduler_terminate() ****************************
* NAME
* sge_scheduler_terminate() -- terminate the scheduler
*
* SYNOPSIS
* void sge_scheduler_terminate(sge_gdi_ctx_class_t *ctx)
*
* FUNCTION
* Terminates the scheduler if it was started previousely. This
* function will return only when it is sure that the pthread canceled.
*
* 'Master_Scheduler' is accessed by this function.
*
* INPUTS
* sge_gdi_ctx_class_t *ctx - context object
* lList **answer_list - answer list
*
* RESULT
* void - None
*
* NOTES
* MT-NOTE: sge_scheduler_terminate() is MT safe
*
* SEE ALSO
* qmaster/threads/sge_scheduler_initialize()
* qmaster/threads/sge_scheduler_cleanup_thread()
* qmaster/threads/sge_scheduler_terminate()
* qmaster/threads/sge_scheduler_main()
*******************************************************************************/
void
sge_scheduler_terminate(sge_gdi_ctx_class_t *ctx, lList **answer_list)
{
DENTER(TOP_LAYER, "sge_scheduler_terminate");
sge_mutex_lock("master scheduler struct", SGE_FUNC, __LINE__, &(Master_Scheduler.mutex));
if (Master_Scheduler.is_running) {
pthread_t thread_id;
cl_thread_settings_t* thread = NULL;
/*
* store thread id to use it later on
*/
thread = cl_thread_list_get_first_thread(Main_Control.scheduler_thread_pool);
thread_id = *(thread->thread_pointer);
/*
* send cancel signal
*/
pthread_cancel(thread_id);
/*
* wakeup scheduler thread which might be blocked by wait for events
*/
pthread_cond_signal(&Scheduler_Control.cond_var);
/*
* cl_thread deletion and cl_thread_pool deletion will be done at
* schedulers cancelation point in sge_scheduler_cleanup_thread() ...
* ... therefore we have nothing more to do.
*/
;
sge_mutex_unlock("master scheduler struct", SGE_FUNC, __LINE__, &(Master_Scheduler.mutex));
INFO((SGE_EVENT, MSG_THREAD_XTERMINATED_S, threadnames[SCHEDD_THREAD]));
answer_list_add(answer_list, SGE_EVENT, STATUS_EUNKNOWN, ANSWER_QUALITY_INFO);
} else {
sge_mutex_unlock("master scheduler struct", SGE_FUNC, __LINE__, &(Master_Scheduler.mutex));
ERROR((SGE_EVENT, MSG_THREAD_XNOTRUNNING_S, threadnames[SCHEDD_THREAD]));
answer_list_add(answer_list, SGE_EVENT, STATUS_EUNKNOWN, ANSWER_QUALITY_ERROR);
}
DRETURN_VOID;
}
示例10: DeleteLines
/*-------------------------------------------------------------------------*/
static void DeleteLines(Widget w, XtPointer cld, XtPointer cad)
{
Widget matrix = (Widget) cld;
int rows;
int i;
int rows_to_delete = 0;
int rows_old;
int max_rows = 7;
DENTER(GUI_LAYER, "DeleteLines");
if (!matrix) {
DEXIT;
return;
}
/* max_rows = XbaeMatrixVisibleRows(matrix); */
rows = rows_old = XbaeMatrixNumRows(matrix);
for (i=0; i<rows; i++)
if (XbaeMatrixIsRowSelected(matrix, i))
rows_to_delete++;
i = 0;
while (i<rows) {
if (XbaeMatrixIsRowSelected(matrix, i)) {
XbaeMatrixDeleteRows(matrix, i, 1);
rows--;
}
else
i++;
}
if ((rows_old - rows_to_delete) < max_rows)
XbaeMatrixAddRows(matrix, rows, NULL, NULL, NULL, (max_rows - rows));
/* reset attribute line */
XbaeMatrixDeselectAll(matrix);
/* refresh the matrix */
XbaeMatrixRefresh(matrix);
DEXIT;
}
示例11: sge_event_master_terminate
void
sge_event_master_terminate(void)
{
cl_thread_settings_t* thread = NULL;
DENTER(TOP_LAYER, "sge_event_master_terminate");
thread = cl_thread_list_get_first_thread(Main_Control.event_master_thread_pool);
while (thread != NULL) {
DPRINTF((SFN" gets canceled\n", thread->thread_name));
cl_thread_list_delete_thread(Main_Control.event_master_thread_pool, thread);
thread = cl_thread_list_get_first_thread(Main_Control.event_master_thread_pool);
}
DPRINTF(("all "SFN" threads terminated\n", threadnames[DELIVERER_THREAD]));
DRETURN_VOID;
}
示例12: qmonReadFile
lList* qmonReadFile(const char *filename)
{
char *text = NULL;
lList *alp = NULL;
DENTER(GUI_LAYER, "qmonReadFile");
text = qmonReadText(filename, &alp);
/* insert file contents in browser */
qmonBrowserShow(text);
/* free all allocated space and close */
XtFree(text);
DRETURN(alp);
}
示例13: sge_error_clear
static void sge_error_clear(sge_error_t *et) {
DENTER(TOP_LAYER, "sge_error_clear");
if (et != NULL) {
sge_error_message_t *elem = et->first;
sge_error_message_t *next;
while (elem != NULL) {
next = elem->next;
sge_error_message_destroy(&elem);
elem = next;
}
et->first = NULL;
et->last = NULL;
}
DEXIT;
}
示例14: host_complexes2scheduler
/* provide a list of attributes containing all attributes for the given host */
int host_complexes2scheduler(
lList **new_centry_list,
lListElem *host,
lList *exechost_list,
lList *centry_list
) {
DENTER(TOP_LAYER, "host_comlexes2scheduler");
if (!host) {
DPRINTF(("!!missing host!!\n"));
}
/* build global complex and add it to result */
lFreeList(new_centry_list);
*new_centry_list = get_attribute_list(host_list_locate(exechost_list, "global"), host, NULL, centry_list);
DRETURN(0);
}
示例15: sge_error_has_quality
static bool sge_error_has_quality(sge_error_class_t* thiz, int error_quality) {
bool ret = false;
DENTER(TOP_LAYER, "sge_error_has_quality");
if(thiz) {
sge_error_t *et = (sge_error_t*)thiz->sge_error_handle;
sge_error_message_t *elem = et->first;
while(elem) {
if(elem->error_quality == error_quality ) {
ret = true;
break;
}
}
}
DEXIT;
return ret;
}