Category:

A category where I will post some of my C# snippets.


Total posts for this category (5):

06 Apr 2019 . cs-snippet . Named Thread & Thread Marked class implementation for Unity3D .


These are two scripts that I use to name the Threads, so when I run a ThreadPool.QueueUserWorkItem (for example) I can know the name of the Queue.

using System;
using System.Collections.Generic;
using System.Threading;
 
namespace GTAMapper.Extensio...

Read more...

06 Apr 2019 . cs-snippet . Implementación de las clases Named Thread y Thread Marked para Unity3D .


Estos dos scripts los uso para darle un nombre a los Threads, así cuando ejecuto un ThreadPool.QueueUserWorkItem (por ejemplo) puedo saber el nombre de la Queue.

using System;
using System.Collections.Generic;
using System.Threading;
 
namespace GTA...

Read more...

05 Apr 2019 . cs-snippet . BatchedCoroutines class implementation for Unity3D .


BatchedCoroutines: Iterar coroutinas one by one

Do you want your ConcurrentQueues to be executed one by one? No problem, with this hard-coded implementation you will get it:

using GTAMapper.Extensions.Threading;
using System;
using System.Collectio...

Read more...

04 Apr 2019 . cs-snippet . ConcurrentQueuedCoroutines class implementation for Unity3D .


ConcurrentQueuedCoroutines: Thread-Safe Implementation of ConcurrentQueues within Coroutinas

The idea of this utility is that when you store items from another thread, you can access it from the main thread.

Mixing this idea with the Coroutinas, wh...


Read more...

03 Apr 2019 . cs-snippet . ThreadSafeBool class implementation for Unity3D .


Some time ago I tried to assign a variable (of bool type) that was declared on the class scope (a global variable) from a different thread, debugging it, it didn’t returned me the value I was expecting, this is way I bring you this utility:

using Sy...

Read more...