本文整理汇总了C++中MONO_OBJECT_SETREF函数的典型用法代码示例。如果您正苦于以下问题:C++ MONO_OBJECT_SETREF函数的具体用法?C++ MONO_OBJECT_SETREF怎么用?C++ MONO_OBJECT_SETREF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MONO_OBJECT_SETREF函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: mono_thread_pool_add
MonoAsyncResult *
mono_thread_pool_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *async_callback,
MonoObject *state)
{
MonoDomain *domain = mono_domain_get ();
MonoAsyncResult *ares;
ASyncCall *ac;
ac = (ASyncCall*)mono_object_new (domain, async_call_klass);
MONO_OBJECT_SETREF (ac, msg, msg);
MONO_OBJECT_SETREF (ac, state, state);
if (async_callback) {
ac->cb_method = mono_get_delegate_invoke (((MonoObject *)async_callback)->vtable->klass);
MONO_OBJECT_SETREF (ac, cb_target, async_callback);
}
ares = mono_async_result_new (domain, NULL, ac->state, NULL, (MonoObject*)ac);
MONO_OBJECT_SETREF (ares, async_delegate, target);
#ifndef DISABLE_SOCKETS
if (socket_io_filter (target, state)) {
socket_io_add (ares, (MonoSocketAsyncResult *) state);
return ares;
}
#endif
threadpool_append_job (&async_tp, (MonoObject *) ares);
return ares;
}
开发者ID:Lavesson,项目名称:mono,代码行数:29,代码来源:threadpool.c
示例2: mono_async_invoke
/* Returns the exception thrown when invoking, if any */
static MonoObject *
mono_async_invoke (ThreadPool *tp, MonoAsyncResult *ares)
{
ASyncCall *ac = (ASyncCall *)ares->object_data;
MonoObject *res, *exc = NULL;
MonoArray *out_args = NULL;
HANDLE wait_event = NULL;
if (ares->execution_context) {
/* use captured ExecutionContext (if available) */
MONO_OBJECT_SETREF (ares, original_context, mono_thread_get_execution_context ());
mono_thread_set_execution_context (ares->execution_context);
} else {
ares->original_context = NULL;
}
if (ac == NULL) {
/* Fast path from ThreadPool.*QueueUserWorkItem */
void *pa = ares->async_state;
mono_runtime_delegate_invoke (ares->async_delegate, &pa, &exc);
} else {
MonoObject *cb_exc = NULL;
ac->msg->exc = NULL;
res = mono_message_invoke (ares->async_delegate, ac->msg, &exc, &out_args);
MONO_OBJECT_SETREF (ac, res, res);
MONO_OBJECT_SETREF (ac, msg->exc, exc);
MONO_OBJECT_SETREF (ac, out_args, out_args);
mono_monitor_enter ((MonoObject *) ares);
ares->completed = 1;
if (ares->handle != NULL)
wait_event = mono_wait_handle_get_handle ((MonoWaitHandle *) ares->handle);
mono_monitor_exit ((MonoObject *) ares);
/* notify listeners */
if (wait_event != NULL)
SetEvent (wait_event);
/* call async callback if cb_method != null*/
if (ac != NULL && ac->cb_method) {
void *pa = &ares;
cb_exc = NULL;
mono_runtime_invoke (ac->cb_method, ac->cb_target, pa, &cb_exc);
MONO_OBJECT_SETREF (ac->msg, exc, cb_exc);
exc = cb_exc;
} else {
exc = NULL;
}
}
/* restore original thread execution context if flow isn't suppressed, i.e. non null */
if (ares->original_context) {
mono_thread_set_execution_context (ares->original_context);
ares->original_context = NULL;
}
return exc;
}
开发者ID:mantasp,项目名称:mono,代码行数:58,代码来源:threadpool.c
示例3: create_simple_asyncresult
static MonoAsyncResult *
create_simple_asyncresult (MonoObject *target, MonoObject *state)
{
MonoDomain *domain = mono_domain_get ();
MonoAsyncResult *ares;
/* Don't call mono_async_result_new() to avoid capturing the context */
ares = (MonoAsyncResult *) mono_object_new (domain, mono_defaults.asyncresult_class);
MONO_OBJECT_SETREF (ares, async_delegate, target);
MONO_OBJECT_SETREF (ares, async_state, state);
return ares;
}
开发者ID:Lavesson,项目名称:mono,代码行数:12,代码来源:threadpool.c
示例4: mono_mlist_prepend
/**
* mono_mlist_prepend:
* @list: the managed list
* @data: the object to add to the list
*
* Allocate a new list node with @data as content and prepend it
* to the list @list. @list can be NULL.
*/
MonoMList*
mono_mlist_prepend (MonoMList* list, MonoObject *data)
{
MonoMList* res = mono_mlist_alloc (data);
if (list)
MONO_OBJECT_SETREF (res, next, list);
return res;
}
开发者ID:zzz77,项目名称:mono,代码行数:16,代码来源:mono-mlist.c
示例5: mono_declsec_create_frame
MonoSecurityFrame*
mono_declsec_create_frame (MonoDomain *domain, MonoJitInfo *jinfo)
{
MonoSecurityFrame *frame = (MonoSecurityFrame*) mono_object_new (domain, mono_defaults.runtimesecurityframe_class);
MonoMethodCasInfo *info;
MonoMethod *method;
method = jinfo_get_method (jinfo);
info = mono_jit_info_get_cas_info (jinfo);
if (info && !info->cas_inited) {
if (mono_method_has_declsec (method)) {
/* Cache the stack modifiers into the MonoJitInfo structure to speed up future stack walks */
mono_declsec_cache_stack_modifiers (jinfo);
}
info->cas_inited = TRUE;
}
MONO_OBJECT_SETREF (frame, method, mono_method_get_object (domain, method, NULL));
MONO_OBJECT_SETREF (frame, domain, domain->domain);
/* stack modifiers on methods have priority on (i.e. replaces) modifiers on class */
if (info && info->cas_method_assert) {
mono_declsec_get_method_action (method, SECURITY_ACTION_ASSERT, &frame->assert);
} else if (info && info->cas_class_assert) {
mono_declsec_get_class_action (method->klass, SECURITY_ACTION_ASSERT, &frame->assert);
}
if (info && info->cas_method_deny) {
mono_declsec_get_method_action (method, SECURITY_ACTION_DENY, &frame->deny);
} else if (info && info->cas_class_deny) {
mono_declsec_get_class_action (method->klass, SECURITY_ACTION_DENY, &frame->deny);
}
if (info && info->cas_method_permitonly) {
mono_declsec_get_method_action (method, SECURITY_ACTION_PERMITONLY, &frame->permitonly);
} else if (info && info->cas_class_permitonly) {
mono_declsec_get_class_action (method->klass, SECURITY_ACTION_PERMITONLY, &frame->permitonly);
}
/* g_warning ("FRAME %s A(%p,%d) D(%p,%d) PO(%p,%d)",
method->name, frame->assert.blob, frame->assert.size, frame->deny.blob, frame->deny.size, frame->permitonly.blob,frame->permitonly.size); */
return frame;
}
开发者ID:Adamcbrz,项目名称:mono,代码行数:45,代码来源:declsec.c
示例6: mono_mlist_set_next
/**
* mono_mlist_set_next:
* @list: a managed list node
* @next: list node that will be next for the @list node.
*
* Set next node for @list to @next.
*/
MonoMList *
mono_mlist_set_next (MonoMList* list, MonoMList *next)
{
if (!list)
return next;
MONO_OBJECT_SETREF (list, next, next);
return list;
}
开发者ID:zzz77,项目名称:mono,代码行数:16,代码来源:mono-mlist.c
示例7: set_message_on_exception
static void
set_message_on_exception (MonoException *exception, MonoErrorInternal *error, MonoError *error_out)
{
MonoString *msg = mono_string_new (mono_domain_get (), error->full_message);
if (msg)
MONO_OBJECT_SETREF (exception, message, msg);
else
mono_error_set_out_of_memory (error_out, "Could not allocate exception object");
}
开发者ID:Appercode,项目名称:mono,代码行数:9,代码来源:mono-error.c
示例8: mono_get_exception_runtime_wrapped
MonoException *
mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception)
{
MonoRuntimeWrappedException *ex = (MonoRuntimeWrappedException*)
mono_exception_from_name (mono_get_corlib (), "System.Runtime.CompilerServices",
"RuntimeWrappedException");
MONO_OBJECT_SETREF (ex, wrapped_exception, wrapped_exception);
return (MonoException*)ex;
}
开发者ID:Alkarex,项目名称:mono,代码行数:10,代码来源:exception.c
示例9: mono_mlist_append
/**
* mono_mlist_append:
* @list: the managed list
* @data: the object to add to the list
*
* Allocate a new list node with @data as content and append it
* to the list @list. @list can be NULL.
* Since managed lists are singly-linked, this operation takes O(n) time.
*/
MonoMList*
mono_mlist_append (MonoMList* list, MonoObject *data)
{
MonoMList* res = mono_mlist_alloc (data);
if (list) {
MonoMList* last = mono_mlist_last (list);
MONO_OBJECT_SETREF (last, next, res);
return list;
} else {
return res;
}
}
开发者ID:zzz77,项目名称:mono,代码行数:21,代码来源:mono-mlist.c
示例10: mono_exception_from_name_msg
/**
* mono_exception_from_name_msg:
* @image: the Mono image where to look for the class
* @name_space: the namespace for the class
* @name: class name
* @msg: the message to embed inside the exception
*
* Creates an exception and initializes its message field.
*
* Returns: the initialized exception instance.
*/
MonoException *
mono_exception_from_name_msg (MonoImage *image, const char *name_space,
const char *name, const char *msg)
{
MonoException *ex;
ex = mono_exception_from_name (image, name_space, name);
if (msg)
MONO_OBJECT_SETREF (ex, message, mono_string_new (mono_object_get_domain ((MonoObject*)ex), msg));
return ex;
}
开发者ID:campolake,项目名称:mono_research,代码行数:24,代码来源:exception.c
示例11: ves_icall_System_Globalization_CompareInfo_assign_sortkey
void ves_icall_System_Globalization_CompareInfo_assign_sortkey (MonoCompareInfo *this_obj, MonoSortKey *key, MonoString *source, gint32 options)
{
MonoArray *arr;
gint32 keylen, i;
keylen=mono_string_length (source);
arr=mono_array_new (mono_domain_get (), mono_get_byte_class (),
keylen);
for(i=0; i<keylen; i++) {
mono_array_set (arr, guint8, i, mono_string_chars (source)[i]);
}
MONO_OBJECT_SETREF (key, key, arr);
}
开发者ID:Profit0004,项目名称:mono,代码行数:15,代码来源:locales.c
示例12: mono_mlist_alloc
/**
* mono_mlist_alloc:
* @data: object to use as data
*
* Allocates a new managed list node with @data as the contents.
* A managed list node also represents a singly-linked list.
* Managed lists are garbage collected, so there is no free routine
* and the user is required to keep references to the managed list
* to prevent it from being garbage collected.
*/
MonoMList*
mono_mlist_alloc (MonoObject *data)
{
MonoError error;
MonoMList* res;
if (!monolist_item_vtable) {
MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoListItem");
monolist_item_vtable = mono_class_vtable (mono_get_root_domain (), klass);
g_assert (monolist_item_vtable);
}
res = (MonoMList*)mono_object_new_fast_checked (monolist_item_vtable, &error);
mono_error_raise_exception (&error);
MONO_OBJECT_SETREF (res, data, data);
return res;
}
开发者ID:zzz77,项目名称:mono,代码行数:25,代码来源:mono-mlist.c
示例13: mono_get_exception_argument_out_of_range
/**
* mono_get_exception_argument_out_of_range:
* @arg: the name of the out of range argument.
*
* Returns: a new instance of the `System.ArgumentOutOfRangeException`
*/
MonoException *
mono_get_exception_argument_out_of_range (const char *arg)
{
MonoException *ex;
ex = mono_exception_from_name (
mono_get_corlib (), "System", "ArgumentOutOfRangeException");
if (arg) {
MonoArgumentException *argex = (MonoArgumentException *)ex;
MONO_OBJECT_SETREF (argex, param_name, mono_string_new (mono_object_get_domain ((MonoObject*)ex), arg));
}
return ex;
}
开发者ID:campolake,项目名称:mono_research,代码行数:21,代码来源:exception.c
示例14: mono_threadpool_ms_enqueue_async_result
void
mono_threadpool_ms_enqueue_async_result (MonoDomain *domain, MonoAsyncResult *ares)
{
static MonoClass *runtime_work_item_class = NULL;
MonoRuntimeWorkItem *rwi;
g_assert (ares);
if (!runtime_work_item_class)
runtime_work_item_class = mono_class_from_name (mono_defaults.corlib, "System.Threading", "MonoRuntimeWorkItem");
g_assert (runtime_work_item_class);
rwi = (MonoRuntimeWorkItem*) mono_object_new (domain, runtime_work_item_class);
MONO_OBJECT_SETREF (rwi, async_result, ares);
mono_threadpool_ms_enqueue_work_item (domain, (MonoObject*) rwi);
}
开发者ID:phenixFire,项目名称:mono,代码行数:17,代码来源:threadpool-ms.c
示例15: mono_mlist_remove_item
/**
* mono_mlist_remove_item:
* @list: the managed list
* @data: the object to remove from the list
*
* Remove the list node @item from the managed list @list.
* Since managed lists are singly-linked, this operation can take O(n) time.
*/
MonoMList*
mono_mlist_remove_item (MonoMList* list, MonoMList *item)
{
MonoMList* prev;
if (list == item) {
list = item->next;
item->next = NULL;
return list;
}
prev = find_prev (list, item);
if (prev) {
MONO_OBJECT_SETREF (prev, next, item->next);
item->next = NULL;
return list;
} else {
/* not found */
return list;
}
}
开发者ID:zzz77,项目名称:mono,代码行数:27,代码来源:mono-mlist.c
示例16: mono_thread_pool_finish
MonoObject *
mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc)
{
ASyncCall *ac;
HANDLE wait_event;
*exc = NULL;
*out_args = NULL;
/* check if already finished */
mono_monitor_enter ((MonoObject *) ares);
if (ares->endinvoke_called) {
*exc = (MonoObject *) mono_get_exception_invalid_operation (NULL);
mono_monitor_exit ((MonoObject *) ares);
return NULL;
}
ares->endinvoke_called = 1;
/* wait until we are really finished */
if (!ares->completed) {
if (ares->handle == NULL) {
wait_event = CreateEvent (NULL, TRUE, FALSE, NULL);
g_assert(wait_event != 0);
MONO_OBJECT_SETREF (ares, handle, (MonoObject *) mono_wait_handle_new (mono_object_domain (ares), wait_event));
} else {
wait_event = mono_wait_handle_get_handle ((MonoWaitHandle *) ares->handle);
}
mono_monitor_exit ((MonoObject *) ares);
WaitForSingleObjectEx (wait_event, INFINITE, TRUE);
} else {
mono_monitor_exit ((MonoObject *) ares);
}
ac = (ASyncCall *) ares->object_data;
g_assert (ac != NULL);
*exc = ac->msg->exc; /* FIXME: GC add write barrier */
*out_args = ac->out_args;
return ac->res;
}
开发者ID:Lavesson,项目名称:mono,代码行数:41,代码来源:threadpool.c
示例17: socket_io_add
static void
socket_io_add (MonoAsyncResult *ares, MonoSocketAsyncResult *state)
{
MonoMList *list;
SocketIOData *data = &socket_io_data;
int fd;
gboolean is_new;
int ievt;
socket_io_init (&socket_io_data);
if (mono_runtime_is_shutting_down () || data->inited == 3 || data->sock_to_state == NULL)
return;
if (async_tp.pool_status == 2)
return;
MONO_OBJECT_SETREF (state, ares, ares);
fd = GPOINTER_TO_INT (state->handle);
EnterCriticalSection (&data->io_lock);
if (data->sock_to_state == NULL) {
LeaveCriticalSection (&data->io_lock);
return;
}
list = mono_g_hash_table_lookup (data->sock_to_state, GINT_TO_POINTER (fd));
if (list == NULL) {
list = mono_mlist_alloc ((MonoObject*)state);
is_new = TRUE;
} else {
list = mono_mlist_append (list, (MonoObject*)state);
is_new = FALSE;
}
mono_g_hash_table_replace (data->sock_to_state, state->handle, list);
ievt = get_events_from_list (list);
data->modify (data->event_data, fd, state->operation, ievt, is_new);
LeaveCriticalSection (&data->io_lock);
}
开发者ID:Lavesson,项目名称:mono,代码行数:37,代码来源:threadpool.c
示例18: mono_mlist_set_data
/**
* mono_mlist_set_data:
* @list: the managed list node
*
* Set the object content in the list node @list.
*/
void
mono_mlist_set_data (MonoMList* list, MonoObject *data)
{
MONO_OBJECT_SETREF (list, data, data);
}
开发者ID:zzz77,项目名称:mono,代码行数:11,代码来源:mono-mlist.c
注:本文中的MONO_OBJECT_SETREF函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论